Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ jobs:
with:
node-version: 20
- run: npm install
- name: Use correct .node binary file
run: cp -f ./server/lib/${{ matrix.platarch }}-isclexer.node ./server/lib/isclexer.node
- name: Build package
env:
ISCLEXER_TARGET: ${{ matrix.platarch }}
run: npx vsce package -o ${{ steps.set-version.outputs.name }}.vsix --target ${{ matrix.platarch }}
- name: Upload package
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -160,4 +160,4 @@ jobs:
git add ./client/package.json
git add ./server/package.json
git commit -m 'auto bump version with release [skip ci]'
git push
git push
28 changes: 28 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Agent Instructions (root)

## Scope and precedence

This file applies to the **entire repository**. More specific instructions in subfolders (e.g. `client/AGENTS.md`, `server/AGENTS.md`) **override** this file in case of conflict.

## Fork goals (Consistem)

- Keep changes as close as possible to the InterSystems upstream.
- Concentrate Consistem-specific behavior in `client/src/ccs/**` and `server/src/ccs/**`, using small “hooks” in the core.

## General rules (for agents)

- Make minimal, localized changes; avoid broad refactors/reformatting.
- Don’t change request/notification IDs (`intersystems/...`) without aligning `client/` and `server/`.
- Avoid touching `package-lock.json` unless necessary (don’t run installs as “formatting”).
- Follow existing style: tabs, and generally single quotes in TS.

## Preferred validation

- `npm run compile` at repo root.
- Manual test via VS Code: `.vscode/launch.json` (“Launch Client”) and, if needed, “Attach to Server” (port 6009).

## Notes

- `server/lib/isclexer.node` is gitignored and must exist locally for runs that use the native lexer.
- Preferred: run `npm run select-isclexer` from repo root (auto-selects for the current OS/arch).
- Cross-build: set `ISCLEXER_TARGET=<platform>-<arch>` (e.g. `win32-x64`) before running `npm run select-isclexer` / `npm run webpack`.
50 changes: 50 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Contribuindo

## Estrutura do projeto

- `client/`: extensão do VS Code (Language Client). Código em `client/src/`, build em `client/out/`.
- `server/`: servidor de linguagem (LSP). Código em `server/src/`, build em `server/out/`.
- `server/lib/`: binários do lexer nativo por plataforma (`*-isclexer.node`) e typings (`isclexer.node.d.ts`).
- `themes/`: temas empacotados.
- `images/`: assets de marketplace/README.

## Comandos (build, teste e desenvolvimento)

Use Node.js 20 (mesma versão do CI).

- `npm install`: Instala dependências na raiz e executa `postinstall` para instalar deps de `client/` e `server/`.
- `npm run compile`: Build TypeScript (`tsc -b`) de `client/` + `server/`.
- `npm run watch`: Build incremental em modo watch.
- `npm run webpack:dev`: Build webpack para desenvolvimento/debug local.
- `npm run webpack`: Build webpack de produção (usado para empacotar).
- `npm run clean`: Remove `client/out` e `server/out`.

Nota do lexer nativo: `server/src/**` importa `server/lib/isclexer.node`, que é gitignored. Crie/atualize o arquivo localmente com:

`npm run select-isclexer`

O comando acima seleciona e copia automaticamente o binário correto (por OS/arquitetura) para `server/lib/isclexer.node`.

Cross-build (ex.: gerar VSIX de Windows a partir do macOS):

`ISCLEXER_TARGET=win32-x64 npm run select-isclexer`

Observação: `npm run webpack` e `npm run webpack:dev` já executam `select-isclexer` automaticamente.

## Estilo de código e convenções

- TypeScript seguindo as convenções do repo: tabs (não espaços) e, em geral, aspas simples.
- Mantenha mudanças consistentes com arquivos próximos (importações, ponto e vírgula, nomes).
- Prefira commits pequenos e focados; evite alterações desnecessárias em lockfiles (`package-lock.json`).

## Testes

Não há uma suíte dedicada de testes unitários neste repositório. Valide mudanças com:

- `npm run compile` (typecheck/build)
- Rodando a extensão via VS Code `.vscode/launch.json` (“Launch Client”) e exercitando a funcionalidade alterada.

## Commits e Pull Requests

- Mensagens de commit costumam ser imperativas e curtas, com referência a issue (ex.: `Fixes #123`).
- No PR, inclua: o que mudou, como validar (passo a passo e/ou arquivo de exemplo), issues relacionadas e plataforma/arquitetura se envolver o lexer nativo.
74 changes: 45 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
# InterSystems Language Server
<p align="center">
<img alt="Consistem" src="https://raw.githubusercontent.com/consistem/vscode-objectscript/master/images/logo-consistem-horizontal.png" width="280" />
</p>

# Consistem Language Server

This is a [LSP](https://microsoft.github.io/language-server-protocol/) compliant language server for [InterSystems](http://www.intersystems.com/our-products/) ObjectScript.
It is powered by **Node.js**, written primarily in **TypeScript**, and designed to integrate seamlessly with editors that support the [LSP standard](https://microsoft.github.io/language-server-protocol/).

## Installation & usage

> **Note:** The best way to install and use this extension is by installing the [InterSystems ObjectScript Extension Pack](https://marketplace.visualstudio.com/items?itemName=intersystems-community.objectscript-pack) and following the [documentation here](https://docs.intersystems.com/components/csp/docbook/DocBook.UI.Page.cls?KEY=GVSCO).

This is a [LSP](https://microsoft.github.io/language-server-protocol/) compliant language server for [InterSystems](http://www.intersystems.com/our-products/) ObjectScript powered by Node.js and written primarily in TypeScript. It is maintained by InterSystems.
## About this fork

This project is a fork of the official [`intersystems/language-server`](https://github.com/intersystems/language-server) repository.

Originally maintained by [InterSystems&reg;](http://www.intersystems.com), this fork is maintained by [Consistem&reg;](https://consistem.com.br/).

It preserves all features of the upstream project and adds integrations, adjustments, and internal standards adopted by Consistem,
with a focus on meeting the specific needs of our development ecosystem.

## Features

Expand Down Expand Up @@ -69,11 +85,11 @@ This is a [LSP](https://microsoft.github.io/language-server-protocol/) compliant
- Hover, code completion and signature help for JavaScript methods in ObjectScript classes and JavaScript embedded in CSP using `<script>` tags or embedded in ObjectScript using the `&js` directive.
- [Code refactoring CodeActions](https://code.visualstudio.com/docs/editor/refactoring#_code-actions-quick-fixes-and-refactorings) for the following:
- Wrapping a block of ObjectScript code in a [Try/Catch block](https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=ATRYCATCHFAQ).
![](images/TryCatch.gif)
![](images/TryCatch.gif)
- Extracting a block of ObjectScript code from an existing method to a new method.
![](images/ExtractMethod.gif)
![](images/ExtractMethod.gif)
- [Type Hierarchy Provider](https://code.visualstudio.com/api/references/vscode-api#TypeHierarchyProvider) for ObjectScript classes to show subclasses and superclasses in a hierarchical tree view:
![](images/TypeHierarchy.gif)
![](images/TypeHierarchy.gif)

## Supported Platforms

Expand All @@ -88,15 +104,15 @@ This extension can be installed on the following platforms:

## Dependencies

This extension requires that the [vscode-objectscript](https://marketplace.visualstudio.com/items?itemName=intersystems-community.vscode-objectscript) extension be downloaded and enabled.
This extension depends on the [vscode-objectscript](https://marketplace.visualstudio.com/items?itemName=consistem-sistemas.vscode-objectscript) extension be downloaded and enabled.

## InterSystems Product Compatibility

All InterSystems products that include the Atelier APIs (Caché/Ensemble from 2016.2 onward, all versions of InterSystems IRIS) are supported.

## Setup Notes

If the configured user for connection to a server does NOT have the `%All` Role, execute the following query on the server to enable all of this extension's features. This is not necessary when connecting to InterSystems IRIS version 2021.1.3+, 2022.1.2+, or 2022.2+.
If the configured user for connection to a server does NOT have the `%All` Role, execute the following query on the server to enable all of this extension's features. This is not necessary when connecting to InterSystems IRIS version 2021.1.3+, 2022.1.2+, or 2022.2+.

```SQL
GRANT SELECT ON SCHEMA %Dictionary TO %Developer
Expand Down Expand Up @@ -160,25 +176,25 @@ To create your own custom color theme that provides coloring for InterSystems se

This extension provides the following high-level semantic tokens for coloring similar features across all supported languages:

| ID | Description |
| -- | ----------- |
| `"ISC_ClassMember"` | InterSystems-wide class member token. |
| `"ISC_ClassName"` | InterSystems-wide class and routine name token. |
| `"ISC_Command"` | InterSystems-wide command token. |
| `"ISC_Comment"` | InterSystems-wide comment token. |
| `"ISC_Delimiter"` | InterSystems-wide delimiter token. |
| `"ISC_DocComment"` | InterSystems-wide documentation comment token. |
| `"ISC_Error"` | InterSystems-wide error token. |
| `"ISC_Keyword"` | InterSystems-wide keyword token. |
| `"ISC_LocalVariable"` | InterSystems-wide local variable token. |
| `"ISC_LocalVariableUnset"` | InterSystems-wide unset local variable token. |
| `"ISC_MarkupText"` | InterSystems-wide markup text token. |
| `"ISC_Neutral"` | InterSystems-wide neutral token. |
| `"ISC_NumericLiteral"` | InterSystems-wide numeric literal token. |
| `"ISC_Operator"` | InterSystems-wide operator token. |
| `"ISC_Parameter"` | InterSystems-wide parameter token. |
| `"ISC_PublicVariable"` | InterSystems-wide public variable and global token. |
| `"ISC_SQLFunction"` | InterSystems-wide SQL function token. |
| `"ISC_SQLKeyword"` | InterSystems-wide SQL keyword and datatype token. |
| `"ISC_StringLiteral"` | InterSystems-wide string literal token. |
| `"ISC_System"` | InterSystems-wide system function and variable token. |
| ID | Description |
| -------------------------- | ----------------------------------------------------- |
| `"ISC_ClassMember"` | InterSystems-wide class member token. |
| `"ISC_ClassName"` | InterSystems-wide class and routine name token. |
| `"ISC_Command"` | InterSystems-wide command token. |
| `"ISC_Comment"` | InterSystems-wide comment token. |
| `"ISC_Delimiter"` | InterSystems-wide delimiter token. |
| `"ISC_DocComment"` | InterSystems-wide documentation comment token. |
| `"ISC_Error"` | InterSystems-wide error token. |
| `"ISC_Keyword"` | InterSystems-wide keyword token. |
| `"ISC_LocalVariable"` | InterSystems-wide local variable token. |
| `"ISC_LocalVariableUnset"` | InterSystems-wide unset local variable token. |
| `"ISC_MarkupText"` | InterSystems-wide markup text token. |
| `"ISC_Neutral"` | InterSystems-wide neutral token. |
| `"ISC_NumericLiteral"` | InterSystems-wide numeric literal token. |
| `"ISC_Operator"` | InterSystems-wide operator token. |
| `"ISC_Parameter"` | InterSystems-wide parameter token. |
| `"ISC_PublicVariable"` | InterSystems-wide public variable and global token. |
| `"ISC_SQLFunction"` | InterSystems-wide SQL function token. |
| `"ISC_SQLKeyword"` | InterSystems-wide SQL keyword and datatype token. |
| `"ISC_StringLiteral"` | InterSystems-wide string literal token. |
| `"ISC_System"` | InterSystems-wide system function and variable token. |
35 changes: 35 additions & 0 deletions client/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Agent Instructions (client/)

## Scope and precedence

This file applies to **everything** under `client/` and complements the root `AGENTS.md`. If there is a conflict, **this file wins** because it is more specific.

## What is `client/`

`client/` contains the **VS Code extension** (Language Client), responsible for activating/starting the server (`LanguageClient`), integrating with VS Code APIs, and orchestrating the editor ⇄ server flow.

## High-level layout

- `client/src/extension.ts`: activation/entrypoint and main `LanguageClient` wiring.
- `client/src/requestForwarding.ts`: middleware and embedded-content provider.
- `client/src/commands.ts`: extension-registered commands.
- `client/src/makeRESTRequest.ts`: client-side REST helper (when applicable).
- `client/src/ccs/**`: Consistem-specific customizations (see rule below).

## Consistem customizations (`client/src/ccs/**`)

Principle: **keep the client core stable** to make upstream merges easier.

- Put in `ccs/`: UX/editor behavior (e.g. formatting control), internal integrations/middleware, and rules that don’t belong upstream.
- Integration: `extension.ts` should only “plug in” `ccs/` modules at clear extension points; avoid scattered “Consistem” conditionals.

## Changes in `extension.ts` and protocols

- Avoid broad changes in activation (merge-conflict hotspot).
- Don’t change request/notification IDs (`intersystems/...`) without aligning with `server/`.

## Quick checklist

- Consistem-specific change lives in `client/src/ccs/**` (when applicable) and the core only “plugs in” what’s needed.
- `npm run compile` passes at repo root.
- Validated in VS Code via `.vscode/launch.json` (“Launch Client”) and reproduced the affected flow.
4 changes: 2 additions & 2 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ type MakeRESTRequestParams = {

export async function activate(context: ExtensionContext) {
// Get the main extension exported API
const objectScriptExt = extensions.getExtension("intersystems-community.vscode-objectscript");
const objectScriptExt = extensions.getExtension("consistem-sistemas.vscode-objectscript");
objectScriptApi = objectScriptExt.isActive ? objectScriptExt.exports : await objectScriptExt.activate();

cookiesCache = new Cache(context, "cookies");
Expand Down Expand Up @@ -376,7 +376,7 @@ export async function activate(context: ExtensionContext) {
if (window.activeColorTheme.kind === ColorThemeKind.Light) {
if (workspace.name === undefined) {
window.showInformationMessage(
`For the best user experience, InterSystems recommends that you activate the default light theme included with the [InterSystems Language Server extension](https://marketplace.visualstudio.com/items?itemName=intersystems.language-server). Activate now?`,
`For the best user experience, InterSystems recommends that you activate the default light theme included with the [InterSystems Language Server extension](https://marketplace.visualstudio.com/items?itemName=consistem-sistemas.language-server). Activate now?`,
"Yes",
"Don't Ask Again"
).then((answer) => {
Expand All @@ -391,7 +391,7 @@ export async function activate(context: ExtensionContext) {
else {
// Only give the "Only This Workspace" option if a workspace is open
window.showInformationMessage(
`For the best user experience, InterSystems recommends that you activate the default light theme included with the [InterSystems Language Server extension](https://marketplace.visualstudio.com/items?itemName=intersystems.language-server). Activate now?`,
`For the best user experience, InterSystems recommends that you activate the default light theme included with the [InterSystems Language Server extension](https://marketplace.visualstudio.com/items?itemName=consistem-sistemas.language-server). Activate now?`,
"Globally",
"Only This Workspace",
"Don't Ask Again"
Expand All @@ -411,7 +411,7 @@ export async function activate(context: ExtensionContext) {
else if (window.activeColorTheme.kind === ColorThemeKind.Dark) {
if (workspace.name === undefined) {
window.showInformationMessage(
`For the best user experience, InterSystems recommends that you activate the default dark theme included with the [InterSystems Language Server extension](https://marketplace.visualstudio.com/items?itemName=intersystems.language-server). Activate now?`,
`For the best user experience, InterSystems recommends that you activate the default dark theme included with the [InterSystems Language Server extension](https://marketplace.visualstudio.com/items?itemName=consistem-sistemas.language-server). Activate now?`,
"Yes",
"Don't Ask Again"
).then((answer) => {
Expand All @@ -426,7 +426,7 @@ export async function activate(context: ExtensionContext) {
else {
// Only give the "Only This Workspace" option if a workspace is open
window.showInformationMessage(
`For the best user experience, InterSystems recommends that you activate the default dark theme included with the [InterSystems Language Server extension](https://marketplace.visualstudio.com/items?itemName=intersystems.language-server). Activate now?`,
`For the best user experience, InterSystems recommends that you activate the default dark theme included with the [InterSystems Language Server extension](https://marketplace.visualstudio.com/items?itemName=consistem-sistemas.language-server). Activate now?`,
"Globally",
"Only This Workspace",
"Don't Ask Again"
Expand Down
Binary file added images/logo-consistem-horizontal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading