Skip to content

Ascot × Language Server - #400

Open
isc-klu wants to merge 25 commits into
intersystems:masterfrom
isc-klu:local-intellisense
Open

isc-klu wants to merge 25 commits into
intersystems:masterfrom
isc-klu:local-intellisense

Conversation

@isc-klu

@isc-klu isc-klu commented Apr 22, 2026 •

Copy link
Copy Markdown
Collaborator

Integrates ascot 0.7.0. The open folders' .cls, .mac, .int and .inc files are analyzed locally; IRIS is asked only for what they lack; a folder with no server uses the declarations bundled with ascot.

Added

  • Diagnostics.
  • Find all references, workspace symbols, inlay hints. A folder of at most ascot.eagerCheckLimit documents (1,000) is analyzed whole after startup, so they cover all of it; workspace symbols from ascot step back for a folder with a server, whose classes the ObjectScript extension already lists.
  • Hover, definition, completion and signature help answered by ascot first, REST as the fallback; a definition in a server document opens it under the uri the ObjectScript extension gives it.
  • Style rules from a folder's style file, named by the intersystems.language-server.ascot.style setting; none by default.
  • intersystems.language-server.trace.ascot, off or on, beside trace.server.

Changes

  • server/src/ascot/index.ts: the integration. One ascot workspace per folder; RestAtelier implements ascot's Atelier over the extension's REST connection, answers docUri through the client, and switches to the bundled declarations when the folder has no server; the request wrappers; if ascot cannot start, the folder stays on the REST providers.
  • server/src/ascot/style.ts: reads the folder's style file into ascot's style.
  • server/src/server.ts: feeds every workspace file to ascot at startup (requests wait for it), checks a small folder whole once initialized, keeps a closed tab's document at its on-disk text, applies configuration changes.
  • server/src/providers/*: ask ascot first, fall through to the existing code on an empty answer.
  • server/webpack.config.js, server/tsconfig.json: the server compiles as nodenext, so webpack carries ascot's wasm and declarations as the ES-module assets the package references.
  • package.json: the settings and the ^0.7.0 dependency.

@isc-klu
isc-klu requested a review from isc-rsingh April 22, 2026 21:43
@isc-klu isc-klu self-assigned this Apr 22, 2026
@isc-klu

isc-klu commented Apr 23, 2026 •

Copy link
Copy Markdown
Collaborator Author

The previous commit implements "go to definition" for classes and class members.

@isc-klu
isc-klu marked this pull request as ready for review April 24, 2026 14:53
@isc-klu
isc-klu requested a review from isc-bsaviano as a code owner April 24, 2026 14:53
@isc-klu
isc-klu marked this pull request as draft August 25, 2026 15:29
@isc-klu
isc-klu marked this pull request as ready for review September 1, 2026 02:23
@isc-klu
isc-klu marked this pull request as draft September 2, 2026 14:55
@isc-klu isc-klu changed the title Local IntelliSense Local ObjectScript intelligence Sep 17, 2026
@isc-klu
isc-klu force-pushed the local-intellisense branch 3 times, most recently from 0f6398d to 74a2856 Compare October 19, 2026 17:30
@isc-klu
isc-klu marked this pull request as ready for review October 19, 2026 17:43
@isc-klu isc-klu changed the title Local ObjectScript intelligence Ascot × Language Server Oct 19, 2026
@isc-klu
isc-klu marked this pull request as draft November 5, 2026 18:25
@isc-klu

isc-klu commented Nov 5, 2026

Copy link
Copy Markdown
Collaborator Author

@isc-bsaviano I am working on integrating ascot v0.5.0, so made this PR draft for now.

@isc-klu
isc-klu marked this pull request as ready for review November 9, 2026 21:08
@isc-klu
isc-klu force-pushed the local-intellisense branch from e41cde8 to 6391016 Compare November 9, 2026 21:10
ascot (intersystems-community/ascot 0.5.1), a type checker for ObjectScript compiled to
WebAssembly, indexes the workspace's .cls/.mac/.int/.inc files and answers from them, asking
IRIS only for what they lack; with no server it checks against the bundled declarations of the
newest IRIS Community release.

- Hover, definition, completion, signature help and document symbols answered by ascot first,
  REST as the fallback; diagnostics beyond syntax; new: references, workspace symbols, inlay
  hints; style rules as settings under intersystems.language-server.ascot.style.
- server/src/ascot: the binding (one workspace per folder, the Atelier interface over the
  extension's REST connection, bundled declarations without a server, startup scan, style
  settings, trace), degrading to REST-only if ascot cannot start.
- webpack copies ascot's wasm and declarations into server/lib, inside the .vsix.
@isc-klu
isc-klu force-pushed the local-intellisense branch from 90aaae9 to 0f70465 Compare November 9, 2026 21:31
…s: the language server's lookups for ascot, its providers and the client's own reads all come through GET /doc/, answered from a cache until the connection or a password changes, an ObjectScript document is saved, or five minutes pass
One cache for the text of server documents, shared by every reader: t…
…ascot's gave the same class and members, and the main extension reads the provider's format
…cot style file, .ascot/style.json by default, in ascot's own format and read when it changes; no style is checked without the file
…er names one, and an empty setting checks no style
… references them as ES-module asset URLs: the copy plugin goes, and the server compiles as nodenext so TypeScript accepts the ES-module package (needs the ascot release that ships it)

(cherry picked from commit 77abe78227ab409600cfc09646691ad6d08f0bce)
…like from its next release on: the conversion goes

(cherry picked from commit 666927a45b4bb85eba20bbca08d8c9f08a3a40d1)
… classes and members the ObjectScript extension already lists; without one they are the only list
…ed whole after the startup scan, between requests, so Find All References and workspace symbols cover all of it
…ension opens a server document under, so a definition into a system class lands in it
…its last server alone, the bundled flag being that state under another name
…tems.language-server.ascot.iris setting names first, and against its server for what the file lacks, so an editor and a CI check share one file; the server alone, or the bundled declarations, without the setting
…ike an unset one, instead of ending the server in path.resolve
…clarations, a file such as .ascot/declarations.d.json.gz, no product name in either; the server requires Node.js 24 and the client VS Code 1.103 in their package.json instead of a JSPI check in code; the startup scan, the style and declaration files and a closed document's disk text are read through fs.promises
…ion ascot's declaration files take from 0.8.0, with or without gzip
…ascot.diagnostics setting, in the syntax of ascot analyze -d, and its inlay hints are shown unless intersystems.language-server.ascot.inlayHints is off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant