nw::script::Nss
-
struct Nss
Public Functions
-
void add_diagnostic(Diagnostic diagnostic)
Add diagnostic to script.
-
void complete(const String &needle, CompletionContext &out, bool no_filter = false) const
Generates a list of potential completions (excluding dependencies)
-
void complete_at(const String &needle, size_t line, size_t character, CompletionContext &out, bool no_filter = false)
Get all completions (including dependencies)
-
void complete_dot(const String &needle, size_t line, size_t character, Vector<Symbol> &out, bool no_filter = false)
Get all completions (including dependencies)
-
Symbol declaration_to_symbol(const Declaration *decl) const
Converts declaration to symbol
Note
Declaration must be in script
-
Vector<String> dependencies() const
Returns all transitive dependencies in ‘preprocessed’ order, i.e. dependencies()[n] was include before dependencies()[n+1]
-
const Vector<Diagnostic> &diagnostics() const noexcept
Gets script diagnostics.
-
inline size_t errors() const noexcept
Returns how many errors were found during parsing.
-
inline immer::map<String, Export> exports() const noexcept
Table of symbols exported from script.
-
inline size_t export_count() const noexcept
Count of symbols exported from script.
-
inline void increment_errors() noexcept
Increments error count.
-
inline void increment_warnings() noexcept
Increments warning count.
-
Vector<InlayHint> inlay_hints(SourceRange range)
-
inline bool is_command_script() const noexcept
Is script a command script.
-
Symbol locate_export(const String &symbol, bool is_type, bool search_dependencies = false) const
Locate export, i.e. a top level symbols.
-
Symbol locate_symbol(const String &symbol, size_t line, size_t character)
Locate symbol in source file.
-
StringView name() const noexcept
Script name.
-
void parse()
Parses script file.
-
void set_name(const String &new_name)
Sets a scripts name.
-
SignatureHelp signature_help(size_t line, size_t character)
-
StringView text() const noexcept
Gets text of script.
-
StringView view_from_range(SourceRange range) const noexcept
Gets a view of source file in specified range.
-
inline size_t warnings() const noexcept
Returns how many warnings were found during parsing.
-
void add_diagnostic(Diagnostic diagnostic)