feat: update to newest tree-sitter-objectscript commit and add language server#9
Merged
Merged
Conversation
This commit moves the objectscript-lsp and objectscript-core crates into this repo. The lsp crate contains all of the logic for interacting with the client (IDE), as well as the calls for goto_definition based on different types of nodes, the goto_implementation calls, and the diagnostic calls. The core crate implements all of the logic for building the underlying structs that are used to represent classes/routines and their methods/procedures/subroutines and pub/priv variables.
First, conditionals now constitute a new scope. For two variable definitions in the same scope: The variable definition that comes last is returned as long as it is still BEFORE the variable reference. (this is for the scenario that the variable definition is in the same method as the variable reference). If this is a public variable resolution where the variable is NOT defined in that method/procedure/subroutine, then the variable definition is looked for in methods that have a call path to the method that the variable reference was in. For example, if I have methods m1, m2, m3, and m2 calls m1 and m3 calls m2, and variable x is public in these, then if I am trying to find the variable definition for x in m1, and it isn't defined in m1, then I would look at m2 and m3 (in order, the first scope that has the variable defined wins) for the variable definition.
hkimura-intersys
marked this pull request as ready for review
July 19, 2026 07:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the
objectscript-lspandobjectscript-corecrates into this repo and wires the language server intoextension.toml.Extension integration
objectscript-lspinextension.tomlfor languagesobjectscript_udl,objectscript_routine,xml,objectscript.github/workflows/release.yml) forobjectscript-lspthat builds the binary files for the objectscript language server on a tag. This is used in the Zed extension.Scope tree changes (
scope_tree.rs)command_if,else_block,elseif_block) now create child scopesget_scope_for_rangeadded to find which scope a given range belongs toget_scope_childrenreturns all descendant scope IDsVariable resolution (
workspace.rs)HashMap<String, Vec<(VariableRef, ScopeId)>>— each definition paired with its scopesetinside anifblock is visible in the parent scope)all_ancestorsto find itDependency graph (
dependency_tracker.rs)DependencyGraphstoresDiGraph<MethodRef, Range>— edge weights are the range of the method call siteall_ancestors(target)uses BFS to return callers ordered by proximity (closest first)add_edge(caller, callee, range)creates caller→callee edgesOref resolution (
workspace.rs,lsp.rs) — NEWget_oref_definitions— oref goto-definition did not exist before thisset result = obj.MethodName()navigates to the method definition from the instance tied to that oref)Class/method name goto-definition — NEW
##class(ClassName)) navigates to that class definitiondo ..MethodName()) navigates to the method definitionDependency graph (
dependency_tracker.rs)all_ancestorsnow returnsVec<(MethodRef, Range, usize)>— includes BFS depthVariable building (
method.rs)setcommand discovery(command_set (set_argument [(set_target) (set_target_list)] @settarget (expression) @value))Public variable resolution (
workspace.rs)find_classes_from_orefRefactoring label change (
refactor.rs)Privatelabel