Analysis
Analysis results
Operations
- CodeAction
- CodeRename
- CollectWorkspaceSymbols
- Completion
- DocumentHighlight
- FindDeclaration
- FindDefinition
- FindImplementation
- FindReferences
- FindTypeDefinition
- GetDiagnostics
- GetSymbols
- HasUses
- Hover
- IncomingCalls
- InlayHints
- IsParsed
- OutgoingCalls
- PrepareCallHierarchy
- PrepareTypeHierarchy
- Release
- SemanticTokens
- SignatureHelp
- TypeHierarchySubtypes
- TypeHierarchySupertypes
- WorkspaceSymbols
CodeAction #
Get signature definitions
method : public : CodeAction(uri:String, start_range_line:Int, start_range_char:Int, var_name:String) ~ ResultParameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| start_range_line | Int | line of symbol |
| start_range_char | Int | character position of symbol |
| var_name | String | variable string name |
Return
| Type | Description |
|---|---|
| Result | symbol references, Nil of none found |
CodeRename #
Renames a variable or method/function
method : public : CodeRename(uri:String, line:Int, pos:Int, sys_path:String) ~ Result[]Parameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| line | Int | line of symbol |
| pos | Int | character position of symbol |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | symbol references, Nil of none found |
CollectWorkspaceSymbols #
Depth-first walk over a Result tree emitted by GetSymbols, appending every named, source-located entry whose lower-cased name contains the needle. Helper for WorkspaceSymbols.
method : private : CollectWorkspaceSymbols(node:Result, needle:String, out:Vector<Result>) ~ NilParameters
| Name | Type | Description |
|---|---|---|
| node | Result | current tree node (nil-safe) |
| needle | String | lower-cased substring; empty matches everything |
| out | Vector<Result> | accumulator |
Completion #
Get completion options
method : public : Completion(uri:String, line:Int, pos:Int, var_str:String, mthd_str:String, sys_path:String) ~ ResultParameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| line | Int | line of symbol |
| pos | Int | character position of symbol |
| var_str | String | variable string name |
| mthd_str | String | method string name |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | completion result, Nil if none found |
Example
analysis := System.Diagnostics.Analyzer->ParseFile("app.obs");
items := analysis->Completion("file:///app.obs", 8, 3, "conn", "", "/usr/lib/objeck");
if(items <> Nil) {
items->ToString()->PrintLine(); # JSON completion list
};
analysis->Release();DocumentHighlight #
Get document highlights for the symbol at the cursor - references scoped to the current file. Backs textDocument/documentHighlight.
method : public : DocumentHighlight(uri:String, line:Int, pos:Int, sys_path:String) ~ Result[]Parameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| line | Int | line of symbol |
| pos | Int | character position of symbol |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | per-file highlights, Nil if nothing to highlight |
FindDeclaration #
Finds symbol deceleration
method : public : FindDeclaration(uri:String, line:Int, pos:Int, sys_path:String) ~ ResultParameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| line | Int | line of symbol |
| pos | Int | character position of symbol |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | symbol deceleration, Nil of none found |
FindDefinition #
Finds symbol definition
method : public : FindDefinition(uri:String, line:Int, pos:Int, sys_path:String) ~ ResultParameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| line | Int | line of symbol |
| pos | Int | character position of symbol |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | symbol definition, Nil if none found |
Example
analysis := System.Diagnostics.Analyzer->ParseFile("app.obs");
defn := analysis->FindDefinition("file:///app.obs", 15, 8, "/usr/lib/objeck");
if(defn <> Nil) {
defn->GetName()->PrintLine(); # name of the defined symbol
};
analysis->Release();FindImplementation #
Finds implementations of an interface or overrides of a virtual method
method : public : FindImplementation(uri:String, line:Int, pos:Int, sys_path:String) ~ Result[]Parameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| line | Int | line of symbol |
| pos | Int | character position of symbol |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | implementation locations, Nil if not found |
FindReferences #
Get references specified symbol
method : public : FindReferences(uri:String, line:Int, pos:Int, sys_path:String) ~ Result[]Parameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| line | Int | line of symbol |
| pos | Int | character position of symbol |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | symbol references, Nil of none found |
Example
analysis := System.Diagnostics.Analyzer->ParseFile("app.obs");
uri := "file:///app.obs";
refs := analysis->FindReferences(uri, 10, 5, "/usr/lib/objeck");
if(refs <> Nil) {
each(i : refs) { refs[i]->ToString()->PrintLine(); };
};
analysis->Release();FindTypeDefinition #
Finds type definition (go to the type of a symbol)
method : public : FindTypeDefinition(uri:String, line:Int, pos:Int, sys_path:String) ~ ResultParameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| line | Int | line of symbol |
| pos | Int | character position of symbol |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | type definition location, Nil if not found |
GetDiagnostics #
Get parse and analysis errors
method : public : GetDiagnostics(was_analyzed:BoolRef, uri:String, sys_path:String) ~ Result[]Parameters
| Name | Type | Description |
|---|---|---|
| was_analyzed | BoolRef | set true if code was successfully analyzed, false otherwise |
| uri | String | file uri |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | analysis errors, Nil of no errors |
Example
analysis := System.Diagnostics.Analyzer->ParseFile("app.obs");
was_ok := BoolRef->New(false);
errs := analysis->GetDiagnostics(was_ok, "file:///app.obs", "/usr/lib/objeck");
if(errs <> Nil) {
each(i : errs) { errs[i]->ToString()->PrintLine(); };
};
analysis->Release();GetSymbols #
Get source code analysis symbols
method : public : GetSymbols(uri:String, sys_path:String) ~ ResultParameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | analysis symbols |
Example
analysis := System.Diagnostics.Analyzer->ParseFile("app.obs");
if(analysis->IsParsed()) {
syms := analysis->GetSymbols("file:///app.obs", "/usr/lib/objeck");
syms->ToString()->PrintLine(); # root symbol tree entry
analysis->Release();
};HasUses #
Check to see if user 'use' statement are present
method : public : HasUses() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | true if user 'use' statement are present, false otherwise |
Hover #
Gets hover signatures
method : public : Hover(uri:String, line:Int, pos:Int, var_str:String, mthd_str:String, sys_path:String) ~ ResultParameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| line | Int | line of symbol |
| pos | Int | character position of symbol |
| var_str | String | variable string name |
| mthd_str | String | method string name |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | hover references, Nil if none found |
Example
analysis := System.Diagnostics.Analyzer->ParseFile("app.obs");
hover := analysis->Hover("file:///app.obs", 20, 12, "conn", "Close", "/usr/lib/objeck");
if(hover <> Nil) {
hover->GetDescription()->PrintLine(); # show signature markdown
};
analysis->Release();IncomingCalls #
Finds all methods that call the target method
method : public : IncomingCalls(uri:String, line:Int, pos:Int, sys_path:String) ~ Result[]Parameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| line | Int | line of symbol |
| pos | Int | character position of symbol |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | incoming call locations, Nil if not found |
InlayHints #
Gets inlay hints for a range of lines
method : public : InlayHints(uri:String, start_line:Int, end_line:Int, sys_path:String) ~ Result[]Parameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| start_line | Int | start line of range |
| end_line | Int | end line of range |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | inlay hints, Nil if none found |
IsParsed #
Check to see if source was parsed
method : public : IsParsed() ~ BoolReturn
| Type | Description |
|---|---|
| Bool | true if parsed, false otherwise |
Example
analysis := System.Diagnostics.Analyzer->ParseFile("app.obs");
if(analysis->IsParsed()) { # true = no syntax errors
"OK"->PrintLine();
} else {
"Syntax error"->PrintLine();
};
analysis->Release();OutgoingCalls #
Finds all methods called by the target method
method : public : OutgoingCalls(uri:String, line:Int, pos:Int, sys_path:String) ~ Result[]Parameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| line | Int | line of symbol |
| pos | Int | character position of symbol |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | outgoing call locations, Nil if not found |
PrepareCallHierarchy #
Prepares call hierarchy item at cursor
method : public : PrepareCallHierarchy(uri:String, line:Int, pos:Int, sys_path:String) ~ ResultParameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| line | Int | line of symbol |
| pos | Int | character position of symbol |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | call hierarchy item, Nil if not found |
PrepareTypeHierarchy #
Return the class-level TypeHierarchyItem at the cursor. Backs textDocument/prepareTypeHierarchy. When the cursor is on a class header, returns that class; when inside a method body, returns the enclosing class. Delegates to FindDefinition since the LSP only needs a "seed" Result that supertypes/subtypes can subsequently operate on.
method : public : PrepareTypeHierarchy(uri:String, line:Int, pos:Int, sys_path:String) ~ ResultParameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| line | Int | line of cursor |
| pos | Int | character position of cursor |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | seed class Result, Nil if cursor is not on or inside a class |
Release #
Release native resources, required for clean up.
method : public : Release() ~ NilExample
analysis := System.Diagnostics.Analyzer->ParseFile("app.obs");
# ... use analysis ...
analysis->Release(); # always release to free C-side parse treeSemanticTokens #
Gets semantic tokens for the file
method : public : SemanticTokens(uri:String, sys_path:String) ~ Result[]Parameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | semantic tokens, Nil if none found |
SignatureHelp #
Get signature definitions
method : public : SignatureHelp(uri:String, line:Int, pos:Int, var_str:String, mthd_str:String, sys_path:String) ~ ResultParameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| line | Int | line of symbol |
| pos | Int | character position of symbol |
| var_str | String | variable string name |
| mthd_str | String | method string name |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | symbol references, Nil of none found |
TypeHierarchySubtypes #
Return classes that directly extend the class at the cursor (and any classes implementing it if it is an interface). Backs typeHierarchy/subtypes. Delegates to FindImplementation, which already walks every bundle for classes whose parent matches the target.
method : public : TypeHierarchySubtypes(uri:String, line:Int, pos:Int, sys_path:String) ~ Result[]Parameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| line | Int | line of cursor |
| pos | Int | character position of cursor |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | direct subtype classes, Nil if no subtypes exist |
TypeHierarchySupertypes #
Walk the parent chain of the class at the cursor, returning each supertype in order (immediate parent first, then grandparent, ...). Backs typeHierarchy/supertypes. User-space only - stops at the first parent that resolves to a library class.
method : public : TypeHierarchySupertypes(uri:String, line:Int, pos:Int, sys_path:String) ~ Result[]Parameters
| Name | Type | Description |
|---|---|---|
| uri | String | file uri |
| line | Int | line of cursor |
| pos | Int | character position of cursor |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | supertype classes (nearest parent first), Nil if no parent found |
WorkspaceSymbols #
Return every workspace symbol whose name contains the query substring (case-insensitive). Backs workspace/symbol (Ctrl+T in VS Code). Matches across every parsed class, method, and enum.
method : public : WorkspaceSymbols(query:String, sys_path:String) ~ Result[]Parameters
| Name | Type | Description |
|---|---|---|
| query | String | substring to match; empty query returns every named symbol |
| sys_path | String | system library path |
Return
| Type | Description |
|---|---|
| Result | flat list of symbol Result entries, Nil if nothing matched |