Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FUSETOOLS2-2508 - Do not register the Camel Language Server for package.json file #2030

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
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.8.0

- Provide folder selection when using `Create Camel Quarkus/SpringBoot Project` command
- Avoid being notified for package.json opening and close as no support is provided for it and every 2 minutes there is a notification for these files

## 1.7.0

Expand Down
20 changes: 17 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import { TelemetryEvent, TelemetryService } from '@redhat-developer/vscode-redhat-telemetry';
import * as path from 'path';
import { ExtensionContext, StatusBarAlignment, StatusBarItem, TextEditor, Uri, commands, languages, window, workspace } from 'vscode';
import { DidChangeConfigurationNotification, LanguageClientOptions } from 'vscode-languageclient';
import { DidChangeConfigurationNotification, DocumentFilter, LanguageClientOptions } from 'vscode-languageclient';
import { Executable, LanguageClient } from 'vscode-languageclient/node';
import * as telemetry from './Telemetry';
import { NewCamelFileCommand } from './commands/NewCamelFileCommand';
Expand All @@ -40,7 +40,21 @@ const SETTINGS_TOP_LEVEL_KEY_CAMEL = 'camel';

let languageClient: LanguageClient;

const SUPPORTED_LANGUAGE_IDS = ['xml', 'java', 'groovy', 'kotlin', 'javascript', 'properties', 'quarkus-properties', 'spring-boot-properties', 'yaml', 'json', 'jsonc'];
const DOCUMENT_SELECTORS :DocumentFilter[] = [
{ language: 'xml' },
{ language: 'java' },
{ language: 'groovy' },
{ language: 'kotlin' },
{ language: 'javascript' },
{ language: 'properties' },
{ language: 'quarkus-properties' },
{ language: 'spring-boot-properties' },
{ language: 'yaml' },
{ language: 'json', pattern: '**/.vscode/*.json' },
{ language: 'jsonc', pattern: '**/.vscode/*.json' },
];
const SUPPORTED_LANGUAGE_IDS = DOCUMENT_SELECTORS.flatMap(docSel => docSel.language);

export async function activate(context: ExtensionContext) {
// Let's enable Javadoc symbols autocompletion, shamelessly copied from MIT licensed code at
// https://github.com/Microsoft/vscode/blob/9d611d4dfd5a4a101b5201b8c9e21af97f06e7a7/extensions/typescript/src/typescriptMain.ts#L186
Expand All @@ -61,7 +75,7 @@ export async function activate(context: ExtensionContext) {

// Options to control the language client
const clientOptions: LanguageClientOptions = {
documentSelector: SUPPORTED_LANGUAGE_IDS,
documentSelector: DOCUMENT_SELECTORS,
synchronize: {
configurationSection: ['camel', 'xml', 'java', 'groovy', 'kotlin', 'javascript', 'properties', 'quarkus-properties', 'spring-boot-properties', 'yaml', 'jsonc'],
// Notify the server about file changes to .xml files contain in the workspace
Expand Down
Loading