Skip to content

Commit

Permalink
Merge pull request #694 from jupyter-lsp/v3.9.0
Browse files Browse the repository at this point in the history
Prepare 3.9.0 release, bump dependencies and tested LSP servers
  • Loading branch information
krassowski authored Oct 17, 2021
2 parents 7eb96d0 + f7fab2a commit d3d6b85
Show file tree
Hide file tree
Showing 43 changed files with 2,370 additions and 1,824 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Changelog

### `@krassowski/jupyterlab-lsp 3.9.0` (unreleased)
### `@krassowski/jupyterlab-lsp 3.9.0` (2021-10-17)

- features:
- signature help box will now persist while typing the arguments of a function ([#671])
Expand Down
4 changes: 2 additions & 2 deletions atest/01_Editor.robot
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CSS

Docker
${def} = Set Variable xpath://span[contains(@class, 'cm-string')][contains(text(), 'PLANET')]
Wait Until Keyword Succeeds 3x 100ms Editor Shows Features for Language Docker Dockerfile Diagnostics=Instruction has no arguments
Wait Until Keyword Succeeds 3x 100ms Editor Shows Features for Language Docker Dockerfile Diagnostics=Instructions should be written in uppercase letters
... Jump to Definition=${def} Rename=${def}

JS
Expand Down Expand Up @@ -71,7 +71,7 @@ SQL
Editor Shows Features for Language SQL example.sql Diagnostics=Expected

YAML
Editor Shows Features for Language YAML example.yaml Diagnostics=duplicate key
Editor Shows Features for Language YAML example.yaml Diagnostics=Map keys must be unique

*** Keywords ***
Editor Shows Features for Server
Expand Down
2 changes: 1 addition & 1 deletion atest/07_Configuration.robot
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ YAML
[Documentation] Composer YAML files don't allow a "greetings" key
Settings Should Change Editor Diagnostics YAML example.yaml yaml-language-server
... {"yaml.schemas": {"http://json.schemastore.org/composer": "*"}}
... duplicate key
... Map keys must be unique
... Property greetings is not allowed.

Markdown
Expand Down
2 changes: 1 addition & 1 deletion atest/examples/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM empty
RUN
run
ARG PLANET="earth"
ENV MY_PLANET="$PLANET"
RUN echo Hello $MY_PLANET
4 changes: 2 additions & 2 deletions atest/examples/composer-schema.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 0
foo:
bar:
bar:
bar: 0
bar: 0
4 changes: 2 additions & 2 deletions atest/examples/example.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
greetings:
hello:
hello:
hello: 0
hello: 0
well:
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^4.8.1",
"@typescript-eslint/parser": "^4.8.1",
"bash-language-server": "^1.17.0",
"bash-language-server": "^2.0.0",
"dictionary-en": "^3.0.0",
"dockerfile-language-server-nodejs": "^0.0.22",
"dockerfile-language-server-nodejs": "^0.7.1",
"eslint": "^7.14.0",
"eslint-config-prettier": "^6.15.0",
"eslint-plugin-import": "^2.22.1",
Expand All @@ -20,14 +20,14 @@
"precise-commits": "^1.0.2",
"prettier": "^2.1.2",
"pyright": "^1.1",
"sql-language-server": "^0.11.4",
"sql-language-server": "^1.1.0",
"typescript": "~4.1.3",
"unified-language-server": "^0.3.0",
"vscode-css-languageserver-bin": "^1.4.0",
"vscode-html-languageserver-bin": "^1.4.0",
"vscode-json-languageserver-bin": "^1.0.1",
"vscode-json-languageservice": "^3.9.1 <3.10.0",
"yaml-language-server": "^0.12.0"
"vscode-json-languageservice": "^4.1.8",
"yaml-language-server": "^1.0.0"
},
"husky": {
"hooks": {}
Expand Down
1 change: 1 addition & 0 deletions packages/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module.exports = {
'no-undef': 'warn',
'no-useless-escape': 'off',
'prefer-const': 'off',
'import/no-unresolved': 'off',
// the default, but for reference...
'import/order': [
'warn',
Expand Down
6 changes: 3 additions & 3 deletions packages/_example-extractor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
},
"devDependencies": {
"@babel/preset-env": "^7.4.3",
"@jupyterlab/application": "^3.0.0",
"@types/chai": "^4.1.7",
"@types/jest": "^23.3.11",
"@jupyterlab/application": "^3.0.0",
"typescript": "~4.1.3",
"chai": "^4.2.0",
"jest": "^26.0.0",
"ts-jest": "^26.4.3",
"chai": "^4.2.0"
"typescript": "~4.1.3"
},
"jupyterlab": {
"extension": true
Expand Down
4 changes: 2 additions & 2 deletions packages/code-jumpers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"@jupyterlab/translation": "^3.0.0"
},
"devDependencies": {
"@babel/preset-env": "^7.4.3",
"@jupyterlab/apputils": "^3.0.0",
"@jupyterlab/codeeditor": "^3.0.0",
"@jupyterlab/coreutils": "^5.0.0",
Expand All @@ -51,8 +52,7 @@
"@jupyterlab/testutils": "^3.0.0",
"@jupyterlab/translation": "^3.0.0",
"rimraf": "^3.0.2",
"typescript": "~4.1.3",
"@babel/preset-env": "^7.4.3"
"typescript": "~4.1.3"
},
"jupyterlab": {
"extension": false,
Expand Down
5 changes: 2 additions & 3 deletions packages/code-jumpers/src/jumpers/notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ export class NotebookJumper extends CodeJumper {
}

getCurrentPosition(): IGlobalPosition {
let position = this.editors[
this.notebook.activeCellIndex
].getCursorPosition();
let position =
this.editors[this.notebook.activeCellIndex].getCursorPosition();

return {
editor_index: this.notebook.activeCellIndex,
Expand Down
55 changes: 28 additions & 27 deletions packages/completion-theme/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,30 +173,31 @@ export class CompletionThemeManager implements ILSPCompletionThemeManager {

const LSP_CATEGORY = 'Language server protocol';

export const COMPLETION_THEME_MANAGER: JupyterFrontEndPlugin<ILSPCompletionThemeManager> = {
id: PLUGIN_ID,
requires: [IThemeManager, ICommandPalette, ITranslator],
activate: (
app,
themeManager: IThemeManager,
commandPalette: ICommandPalette,
translator: ITranslator
) => {
const trans = translator.load('jupyterlab_lsp');
let manager = new CompletionThemeManager(themeManager, trans);
const command_id = 'lsp:completer-about-themes';
app.commands.addCommand(command_id, {
label: trans.__('Display the completer themes'),
execute: () => {
manager.display_themes();
}
});
commandPalette.addItem({
category: LSP_CATEGORY,
command: command_id
});
return manager;
},
provides: ILSPCompletionThemeManager,
autoStart: true
};
export const COMPLETION_THEME_MANAGER: JupyterFrontEndPlugin<ILSPCompletionThemeManager> =
{
id: PLUGIN_ID,
requires: [IThemeManager, ICommandPalette, ITranslator],
activate: (
app,
themeManager: IThemeManager,
commandPalette: ICommandPalette,
translator: ITranslator
) => {
const trans = translator.load('jupyterlab_lsp');
let manager = new CompletionThemeManager(themeManager, trans);
const command_id = 'lsp:completer-about-themes';
app.commands.addCommand(command_id, {
label: trans.__('Display the completer themes'),
execute: () => {
manager.display_themes();
}
});
commandPalette.addItem({
category: LSP_CATEGORY,
command: command_id
});
return manager;
},
provides: ILSPCompletionThemeManager,
autoStart: true
};
2 changes: 1 addition & 1 deletion packages/jupyterlab-lsp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@krassowski/jupyterlab-lsp",
"version": "3.8.1",
"version": "3.9.0",
"description": "Language Server Protocol integration for JupyterLab",
"keywords": [
"jupyter",
Expand Down
19 changes: 10 additions & 9 deletions packages/jupyterlab-lsp/src/adapter_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,13 @@ export class WidgetAdapterManager implements ILSPAdapterManager {
}
}

export const WIDGET_ADAPTER_MANAGER: JupyterFrontEndPlugin<ILSPAdapterManager> = {
id: PLUGIN_ID + ':ILSPAdapterManager',
activate: app => {
let shell = app.shell as ILabShell | IRetroShell;
return new WidgetAdapterManager(shell);
},
provides: ILSPAdapterManager,
autoStart: true
};
export const WIDGET_ADAPTER_MANAGER: JupyterFrontEndPlugin<ILSPAdapterManager> =
{
id: PLUGIN_ID + ':ILSPAdapterManager',
activate: app => {
let shell = app.shell as ILabShell | IRetroShell;
return new WidgetAdapterManager(shell);
},
provides: ILSPAdapterManager,
autoStart: true
};
10 changes: 4 additions & 6 deletions packages/jupyterlab-lsp/src/adapters/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -660,9 +660,8 @@ export abstract class WidgetAdapter<T extends IDocumentWidget> {
}

for (let feature of features) {
let featureEditorIntegrationConstructor = feature.editorIntegrationFactory.get(
this.virtual_editor.editor_name
);
let featureEditorIntegrationConstructor =
feature.editorIntegrationFactory.get(this.virtual_editor.editor_name);
let integration = new featureEditorIntegrationConstructor({
feature: feature,
virtual_editor: this.virtual_editor,
Expand Down Expand Up @@ -725,9 +724,8 @@ export abstract class WidgetAdapter<T extends IDocumentWidget> {

get_context(root_position: IRootPosition): ICommandContext {
let document = this.virtual_editor.document_at_root_position(root_position);
let virtual_position = this.virtual_editor.root_position_to_virtual_position(
root_position
);
let virtual_position =
this.virtual_editor.root_position_to_virtual_position(root_position);
return {
document,
connection: this.connection_manager.connections.get(document.uri),
Expand Down
5 changes: 2 additions & 3 deletions packages/jupyterlab-lsp/src/adapters/notebook/notebook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -349,9 +349,8 @@ export class NotebookAdapter extends WidgetAdapter<NotebookPanel> {
}

private get_cell_at(pos: IVirtualPosition): Cell {
let ce_editor = this.virtual_editor.virtual_document.get_editor_at_virtual_line(
pos
);
let ce_editor =
this.virtual_editor.virtual_document.get_editor_at_virtual_line(pos);
return this.ce_editor_to_cell.get(ce_editor);
}
}
25 changes: 14 additions & 11 deletions packages/jupyterlab-lsp/src/components/statusbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,8 @@ class LSPPopup extends VDomRenderer<LSPStatus.Model> {

const missing_languages = this.model.missing_languages.map(
(language, i) => {
const specs_for_missing = this.model.language_server_manager.getMatchingSpecs(
{ language }
);
const specs_for_missing =
this.model.language_server_manager.getMatchingSpecs({ language });
return (
<div key={i} className={'lsp-missing-server'}>
{language}
Expand Down Expand Up @@ -500,7 +499,8 @@ export class LSPStatus extends VDomRenderer<LSPStatus.Model> {
}

export class StatusButtonExtension
implements DocumentRegistry.IWidgetExtension<NotebookPanel, INotebookModel> {
implements DocumentRegistry.IWidgetExtension<NotebookPanel, INotebookModel>
{
constructor(
private options: {
language_server_manager: LanguageServerManager;
Expand All @@ -519,7 +519,8 @@ export class StatusButtonExtension
displayText,
this.options.translator_bundle
);
status_bar_item.model.language_server_manager = this.options.language_server_manager;
status_bar_item.model.language_server_manager =
this.options.language_server_manager;
status_bar_item.model.connection_manager = this.options.connection_manager;
return status_bar_item;
}
Expand Down Expand Up @@ -665,9 +666,10 @@ export namespace LSPStatus {

for (let document of documents.values()) {
let language = document.language.toLocaleLowerCase();
let server_ids = this._connection_manager.language_server_manager.getMatchingServers(
{ language: document.language }
);
let server_ids =
this._connection_manager.language_server_manager.getMatchingServers({
language: document.language
});
if (server_ids.length === 0) {
continue;
}
Expand Down Expand Up @@ -739,9 +741,10 @@ export namespace LSPStatus {

detected_documents.forEach((document, uri) => {
let connection = this._connection_manager.connections.get(uri);
let server_ids = this._connection_manager.language_server_manager.getMatchingServers(
{ language: document.language }
);
let server_ids =
this._connection_manager.language_server_manager.getMatchingServers({
language: document.language
});

if (server_ids.length !== 0) {
documents_with_known_servers.add(document);
Expand Down
Loading

0 comments on commit d3d6b85

Please sign in to comment.