Skip to content

Fix ServerSpec | undefined type safety and wire up TS project references - #414

Merged
isc-klu merged 22 commits into
intersystems:masterfrom
isc-klu:fix/server-spec-undefined-type
Aug 25, 2026
Merged

Fix ServerSpec | undefined type safety and wire up TS project references#414
isc-klu merged 22 commits into
intersystems:masterfrom
isc-klu:fix/server-spec-undefined-type

Conversation

@isc-klu

@isc-klu isc-klu commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

This fixes #413.

getServerSpec() could return undefined at runtime, but was typed as always returning ServerSpec, silently masking unresolved-server crashes at every call site. This PR fixes the types, adds guards, and wires up TS project references so common's types are enforced across client/server.

- Fix getServerSpec and ProtocolMethods resolveFromUri to return ServerSpec | undefined
- Add guards at all getServerSpec call sites across providers
- Fix resolveServerSpec in client to avoid non-null assertion
- Add TS project references for common from client/server/root
- Update clean script to remove tsbuildinfo files
- Rename deprecated typescript.* settings to js/ts.*
@isc-klu
isc-klu marked this pull request as ready for review August 21, 2026 16:28
@isc-klu
isc-klu requested a review from isc-bsaviano as a code owner August 21, 2026 16:28
Comment thread client/src/extension.ts Outdated
Comment thread .vscode/settings.json Outdated
Comment thread server/src/providers/diagnostic.ts Outdated
Comment thread server/src/providers/hover.ts
Comment thread client/src/extension.ts
Comment thread server/src/providers/completion.ts Outdated
Comment thread server/src/providers/diagnostic.ts Outdated
@isc-klu
isc-klu requested a review from isc-bsaviano August 21, 2026 20:42
@isc-klu isc-klu self-assigned this Aug 21, 2026
Comment thread server/src/providers/diagnostic.ts Outdated
@isc-klu
isc-klu requested a review from isc-bsaviano August 24, 2026 14:25
@isc-bsaviano

Copy link
Copy Markdown
Collaborator

I downloaded the latest dev VSIX for this PR but am still seeing the issue:

[Error - 8:37:18 AM] Request textDocument/diagnostic failed.
  Message: Request textDocument/diagnostic failed with message: Cannot read properties of undefined (reading 'toUpperCase')
  Code: -32603 
[Error - 8:37:18 AM] Document pull failed for text document file:///Users/bsaviano/Perforce/iris/latest/databases/enslib/cls/Ens/Rule/UI/RuleDocument.cls
  Message: Request textDocument/diagnostic failed with message: Cannot read properties of undefined (reading 'toUpperCase')
  Code: -32603

Comment thread client/src/extension.ts
@isc-klu
isc-klu requested a review from isc-bsaviano August 25, 2026 20:15

@isc-bsaviano isc-bsaviano left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed this worked with linked main extension PR

@isc-klu
isc-klu merged commit f9eb765 into intersystems:master Aug 25, 2026
11 checks passed
@isc-klu
isc-klu deleted the fix/server-spec-undefined-type branch August 26, 2026 01:36
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.

Diagnositics fail when running on a document that has no server connection

2 participants