14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/main/resources/META-INF/plugin-json.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
7 |
8 |
10 |
11 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/gopls/README.md:
--------------------------------------------------------------------------------
1 | You can use the [Go language server](https://pkg.go.dev/golang.org/x/tools/gopls) by following these instructions:
2 | * [Download and install Go](https://go.dev/doc/install)
3 | * [Read the "Installation" section](https://pkg.go.dev/golang.org/x/tools/gopls#section-readme) to install the Go language server **gopls**, basically, open a terminal and execute the following command:
4 |
5 | **go install golang.org/x/tools/gopls@latest**
6 |
7 | As the command will add **go** in your OS PATH, you will have to close and reopen your IDE to update this PATH.
--------------------------------------------------------------------------------
/src/main/resources/templates/dap/python-debugpy/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "python-debugpy",
3 | "name": "Python - Debugpy",
4 | "attach": {
5 | "address": "$connect.host",
6 | "port": "$connect.port"
7 | },
8 | "fileTypeMappings": [
9 | {
10 | "fileType": {
11 | "patterns": [
12 | "*.py",
13 | "*.rpy",
14 | "*.pyw",
15 | "*.cpy",
16 | "*.gyp",
17 | "*.gypi",
18 | "*.pyi",
19 | "*.ipy",
20 | "*.pyt"
21 | ]
22 | },
23 | "languageId": "python"
24 | }
25 | ]
26 | }
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/rust-analyzer/experimental.json:
--------------------------------------------------------------------------------
1 | {
2 | "snippetTextEdit": true,
3 | "codeActionGroup": true,
4 | "hoverActions": true,
5 | "serverStatusNotification": true,
6 | "colorDiagnosticOutput": true,
7 | "openServerLogs": true,
8 | "localDocs": true,
9 | "testExplorer": false,
10 | "commands": {
11 | "commands": [
12 | "rust-analyzer.runSingle",
13 | "rust-analyzer.debugSingle",
14 | "rust-analyzer.showReferences",
15 | "rust-analyzer.gotoLocation",
16 | "rust-analyzer.triggerParameterHints",
17 | "rust-analyzer.rename"
18 | ]
19 | }
20 | }
--------------------------------------------------------------------------------
/set_release_version.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | GRADLE_PROPERTIES_FILE="gradle.properties"
4 |
5 | # Read the current version from gradle.properties
6 | CURRENT_VERSION=$(grep "pluginVersion=" "$GRADLE_PROPERTIES_FILE" | cut -d'=' -f2)
7 |
8 | # Remove the "-SNAPSHOT" suffix from the current version
9 | NEW_VERSION=${CURRENT_VERSION%-SNAPSHOT}
10 |
11 | # Update the gradle.properties file with the new version
12 | awk -v current="$CURRENT_VERSION" -v new="$NEW_VERSION" 'BEGIN {FS=OFS="="} $1 == "pluginVersion" { $2 = new }1' "$GRADLE_PROPERTIES_FILE" > tmpfile && mv tmpfile "$GRADLE_PROPERTIES_FILE"
13 |
14 | echo $NEW_VERSION
15 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/eo-lsp-server/settings.schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-07/schema#",
3 | "$id": "LSP4IJ/eo-lsp-server/settings.schema.json",
4 | "title": "LSP4IJ EOLANG LSP server settings JSON schema",
5 | "description": "JSON schema for EOLANG LSP server server settings.",
6 | "type": "object",
7 | "additionalProperties": false,
8 | "properties": {
9 | "languageServerExample.maxNumberOfProblems": {
10 | "type": "number",
11 | "default": 100,
12 | "description": "Controls the maximum number of problems produced by the server."
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/main/resources/intentionDescriptions/Rewrite/description.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Rewrite:
4 | base kind for refactoring rewrite actions: refactor.rewrite.
5 |
6 | Example rewrite actions:
7 |
8 |
Convert JavaScript function to class
9 |
Add or remove parameter
10 |
Encapsulate field
11 |
Make method static
12 |
Move method to base class
13 |
...
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/http.zy:
--------------------------------------------------------------------------------
1 | namespace App;
2 |
3 | $server = new Net\Http\Server("0.0.0.0", port: 8080);
4 |
5 | $server->get("/", ($request, $response) => {
6 | $response->write("Hello Word");
7 | })
8 |
9 | $group = $server->group("/user");
10 |
11 | $group->middleware(($request, $response, $next) => {
12 | echo "中间件开始\n"
13 |
14 | $next($request, $response)
15 |
16 | echo "中间件结束\n"
17 | })
18 |
19 | $group->get("/list", ($request, $response) => {
20 | $response->json({
21 | "list": "aaaa"
22 | });
23 | })
24 |
25 | $server->run();
26 |
27 | function test() {
28 | echo "test\n";
29 | }
30 |
31 |
32 |
33 |
34 | test()
--------------------------------------------------------------------------------
/src/main/resources/templates/dap/julia/server.jl:
--------------------------------------------------------------------------------
1 | using Pkg
2 | Pkg.instantiate()
3 |
4 | using Sockets
5 | using DebugAdapter
6 | using Logging
7 |
8 | function start_debugger()
9 | try
10 | server_port = parse(Int, ARGS[1])
11 | server = Sockets.listen(server_port)
12 | println("Listening on port $server_port")
13 |
14 | conn = Sockets.accept(server)
15 | println("Client connected")
16 |
17 | debugsession = DebugAdapter.DebugSession(conn)
18 | run(debugsession)
19 |
20 | close(conn)
21 | catch e
22 | println("Error: ", e)
23 | end
24 | end
25 | start_debugger()
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/terraform-ls/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "terraform.codelens.referenceCount": false,
3 | "terraform.validation.enableEnhancedValidation": true,
4 | "terraform.languageServer.enable": true,
5 | "terraform.languageServer.path": "",
6 | "terraform.languageServer.args": [
7 | "serve"
8 | ],
9 | "terraform.languageServer.ignoreSingleFileWarning": false,
10 | "terraform.languageServer.indexing.ignorePaths": [],
11 | "terraform.languageServer.indexing.ignoreDirectoryNames": [],
12 | "terraform.experimentalFeatures.validateOnSave": false,
13 | "terraform.experimentalFeatures.prefillRequiredFields": false
14 | }
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/typescript-language-server/clientSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "caseSensitive": true,
3 | "lineCommentPrefix": "//",
4 | "blockCommentPrefix": "/*",
5 | "blockCommentSuffix": "*/",
6 | "statementTerminatorCharacters": ";",
7 | "completion": {
8 | "useContextAwareSorting": true,
9 | "useTemplateForInvocationOnlySnippet": false
10 | },
11 | "format": {
12 | "onTypeFormatting": {
13 | "clientSide": {
14 | "formatOnCloseBrace": true,
15 | "formatOnStatementTerminator": true,
16 | "formatOnCompletionTrigger": true
17 | }
18 | }
19 | },
20 | "workspaceSymbol": {
21 | "supportsGotoClass": true
22 | }
23 | }
--------------------------------------------------------------------------------
/src/main/resources/templates/dap/go-delve/installer.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "go-delve",
3 | "name": "Install and verify go-delve DAP Server",
4 | "check": {
5 | "exec": {
6 | "name": "Trying current command",
7 | "command": "${server.command}",
8 | "timeout": 2000
9 | }
10 | },
11 | "run": {
12 | "exec": {
13 | "name": "Install 'go-delve' release",
14 | "command": "go install github.com/go-delve/delve/cmd/dlv@latest",
15 | "onSuccess": {
16 | "configureServer": {
17 | "name": "Configure go-delve server command",
18 | "command": "dlv dap",
19 | "update": true
20 | }
21 | }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/zy-lsp/installer.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "zy-lsp",
3 | "name": "Install and verify ZY Language Server",
4 | "executeOnStartServer": false,
5 | "check": {
6 | "exec": {
7 | "name": "Trying current command",
8 | "command": "${server.command}",
9 | "timeout": 2000,
10 | "onFail": {
11 | "showMessage": {
12 | "name": "ZY Language Server not found",
13 | "content": [
14 | "Please install the ZY Language Server (zy-lsp) and make sure it's available in your PATH.",
15 | "Restart your IDE after installation."
16 | ]
17 | }
18 | }
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/docs/user-defined-ls/ruby-lsp.md:
--------------------------------------------------------------------------------
1 | # Ruby LSP
2 |
3 | ## Install the language server
4 |
5 | 1. **Open the New Language Server Dialog**. This can usually be found under the IDE settings related to Language Server Protocol (LSP). For more information, refer to the [New Language Server Dialog documentation](../UserDefinedLanguageServer.md#new-language-server-dialog).
6 |
7 | 2. **Select `Ruby LSP` as the template** from the available options.
8 | This will populate the command field with a default command. When a ruby file will be opened it should install the ruby-lsp and Ruby support
9 | should be available.
10 |
11 | 
12 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/luau-lsp/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "luau-lsp",
3 | "name": "Luau Language Server",
4 | "url": null,
5 | "programArgs": {
6 | "windows": "path/to/your/luau-lsp.exe lsp --definitions=path/to/your/globalTypes.d.luau --docs=path/to/your/rb-docs.json",
7 | "default": "path/to/your/luau-lsp lsp --definitions=path/to/your/globalTypes.d.luau --docs=path/to/your/rb-docs.json"
8 | },
9 | "expandConfiguration": true,
10 | "fileTypeMappings": [
11 | {
12 | "fileType": {
13 | "name": "Luau",
14 | "patterns": [
15 | "*.luau",
16 | "*.lua"
17 | ]
18 | },
19 | "languageId": "luau"
20 | }
21 | ]
22 | }
--------------------------------------------------------------------------------
/src/main/resources/templates/dap/codelldb/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "codelldb",
3 | "name": "CodeLLDB",
4 | "launch": {
5 | "windows": "<>/extension/adapter/codelldb.exe",
6 | "default": "<>/extension/adapter/codelldb"
7 | },
8 | "fileTypeMappings": [
9 | {
10 | "fileType": {
11 | "name": "Rust",
12 | "patterns": [
13 | "*.rs"
14 | ]
15 | },
16 | "languageId": "rust"
17 | },
18 | {
19 | "fileType": {
20 | "name": "ra_syntax_tree",
21 | "patterns": [
22 | "*.rast"
23 | ]
24 | },
25 | "languageId": "ra_syntax_tree"
26 | }
27 | ]
28 | }
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/vscode-css-language-server/README.md:
--------------------------------------------------------------------------------
1 | You can use [Visual Studio Code's CSS language server](https://github.com/microsoft/vscode-css-languageservice) by following these instructions:
2 | * [Install Node.js](https://nodejs.org/en/download)
3 | * [Download and install Visual Studio Code](https://code.visualstudio.com/download)
4 |
5 | Once Visual Studio Code is installed, it will store the CSS language server in:
6 | > **${BASE_DIR}/resources/app/extensions/css-language-features/server/dist/node/cssServerMain.js**
7 |
8 | [LSP4IJ](https://github.com/redhat-developer/lsp4ij) tries to generate the proper **cssServerMain.js** file path according to your OS, but you may have to adjust it.
9 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/clangd/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "clangd.path": "clangd",
3 | "clangd.useScriptAsExecutable": false,
4 | "clangd.arguments": [],
5 | "clangd.semanticHighlighting": true,
6 | "clangd.fallbackFlags": [],
7 | "clangd.serverCompletionRanking": true,
8 | "clangd.restartAfterCrash": true,
9 | "clangd.checkUpdates": false,
10 | "clangd.onConfigChanged": "prompt",
11 | "clangd.onConfigChanged.forceEnable": false,
12 | "clangd.detectExtensionConflicts": true,
13 | "clangd.inactiveRegions.useBackgroundHighlight": false,
14 | "clangd.inactiveRegions.opacity": 0.55,
15 | "clangd.enableCodeCompletion": true,
16 | "clangd.enableHover": true,
17 | "clangd.enable": true
18 | }
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/vscode-html-language-server/README.md:
--------------------------------------------------------------------------------
1 | You can use [Visual Studio Code's HTML language server](https://github.com/microsoft/vscode-html-languageservice) by following these instructions:
2 | * [Install Node.js](https://nodejs.org/en/download)
3 | * [Download and install Visual Studio Code](https://code.visualstudio.com/download)
4 |
5 | Once Visual Studio Code is installed, it will store the CSS language server in:
6 | > **${BASE_DIR}/resources/app/extensions/html-language-features/server/dist/node/htmlServerMain.js**
7 |
8 | [LSP4IJ](https://github.com/redhat-developer/lsp4ij) tries to generate the proper **htmlServerMain.js** file path according to your OS, but you may have to adjust it.
9 |
--------------------------------------------------------------------------------
/docs/user-defined-ls/clangd.md:
--------------------------------------------------------------------------------
1 | # Clangd
2 |
3 | ## Install the language server
4 |
5 | 1. **Open the New Language Server Dialog**. This can usually be found under the IDE settings related to Language Server Protocol (LSP). For more information, refer to the [New Language Server Dialog documentation](../UserDefinedLanguageServer.md#new-language-server-dialog).
6 |
7 | 2. **Select `Clangd` as the template** from the available options.
8 | This will populate the command field with a default command. When an *.c, *.h (etc) file will be opened it should install the Clangd language server
9 | and *.c, *.h support should be available.
10 |
11 | 
12 |
--------------------------------------------------------------------------------
/.github/workflows/changelog.yml:
--------------------------------------------------------------------------------
1 | name: Generate changelog
2 | on:
3 | workflow_dispatch:
4 | inputs:
5 | tag:
6 | description: 'Tag of release'
7 | required: true
8 | jobs:
9 | build:
10 | runs-on: ubuntu-latest
11 | steps:
12 | - uses: actions/checkout@v4
13 | - name: Simple conventional changelog
14 | uses: redhat-developer/simple-conventional-changelog@0a6db1ac3910c2cf66f2e1a530951dba1ece8540 #0.0.12
15 | id: changelog
16 | with:
17 | token: ${{ secrets.GITHUB_TOKEN }}
18 | current-tag: '${{ github.event.inputs.tag }}'
19 | types-mapping: 'feat:Features,fix:Bug Fixes,docs:Documentation,refactor:Refactoring,chore:Other'
20 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/rust-analyzer/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "rust-analyzer",
3 | "name": "Rust Language Server",
4 | "programArgs": {
5 | "default": "sh -c ${BASE_DIR}/rust-analyzer",
6 | "windows": "${BASE_DIR}/rust-analyzer.exe"
7 | },
8 | "expandConfiguration": true,
9 | "fileTypeMappings": [
10 | {
11 | "fileType": {
12 | "name": "Rust",
13 | "patterns": [
14 | "*.rs"
15 | ]
16 | },
17 | "languageId": "rust"
18 | },
19 | {
20 | "fileType": {
21 | "name": "ra_syntax_tree",
22 | "patterns": [
23 | "*.rast"
24 | ]
25 | },
26 | "languageId": "ra_syntax_tree"
27 | }
28 | ]
29 | }
30 |
--------------------------------------------------------------------------------
/docs/user-defined-ls/vscode-html-language-server.md:
--------------------------------------------------------------------------------
1 | # HTML Language Server
2 |
3 | You can use [Visual Studio Code's HTML language server](https://github.com/microsoft/vscode-html-languageservice) by following these instructions:
4 | * [Install Node.js](https://nodejs.org/en/download)
5 | * [Download and install Visual Studio Code](https://code.visualstudio.com/download)
6 |
7 | Once Visual Studio Code is installed, it will store the CSS language server in:
8 | > **${BASE_DIR}/resources/app/extensions/html-language-features/server/dist/node/htmlServerMain.js**
9 |
10 | [LSP4IJ](https://github.com/redhat-developer/lsp4ij) tries to generate the proper **htmlServerMain.js** file path according to your OS, but you may have to adjust it.
11 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/filetypes/ZYSyntaxHighlighterFactory.java:
--------------------------------------------------------------------------------
1 | package com.redhat.devtools.lsp4ij.filetypes;
2 |
3 | import com.intellij.openapi.fileTypes.SyntaxHighlighter;
4 | import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory;
5 | import com.intellij.openapi.project.Project;
6 | import com.intellij.openapi.vfs.VirtualFile;
7 | import org.jetbrains.annotations.NotNull;
8 | import org.jetbrains.annotations.Nullable;
9 |
10 | public class ZYSyntaxHighlighterFactory extends SyntaxHighlighterFactory {
11 | @Override
12 | public @NotNull SyntaxHighlighter getSyntaxHighlighter(@Nullable Project project, @Nullable VirtualFile virtualFile) {
13 | return new ZYSyntaxHighlighter();
14 | }
15 | }
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/jdtls/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "jdt-ls",
3 | "name": "JDT Language Server",
4 | "dev": true,
5 | "url": null,
6 | "programArgs": {
7 | "windows": "\"${BASE_DIR}/bin/jdtls.bat\" -configuration \"C:/Users/${user.name}/.cache/jdtls\" -data \"$DATA_DIR\"",
8 | "default": "\"${BASE_DIR}/bin/jdtls\" -configuration \"~/.cache/jdtls\" -data \"$DATA_DIR\""
9 | },
10 | "languageMappings": [
11 | {
12 | "language": "JAVA",
13 | "languageId": "java"
14 | }
15 | ],
16 | "fileTypeMappings": [
17 | {
18 | "fileType": {
19 | "name": "JAVA",
20 | "patterns": [
21 | "*.java"
22 | ]
23 | },
24 | "languageId": "java"
25 | }
26 | ]
27 | }
--------------------------------------------------------------------------------
/USAGE_DATA.md:
--------------------------------------------------------------------------------
1 | ## [Language Server Protocol Client for IntelliJ](https://github.com/redhat-developer/lsp4ij)
2 |
3 | ### Usage Data
4 |
5 | LSP4IJ has opt-in telemetry collection, provided the [Red Hat Telemetry](https://github.com/redhat-developer/intellij-redhat-telemetry) plugin is installed.
6 |
7 | ## What's included in the LSP4IJ telemetry data
8 |
9 | * LSP4IJ emits telemetry events when the extension starts and stops,
10 | which contain the common data mentioned on the
11 | [vscode-redhat-telemetry page](https://github.com/redhat-developer/intellij-redhat-telemetry/blob/main/USAGE_DATA.md).
12 | * Events for added/removed servers. Includes:
13 | * whether the server was set manually
14 | * the server name, if it was selected from a template and was unchanged
15 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/vscode-eslint-language-server/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "validate": "on",
3 | "packageManager": "npm",
4 | "useESLintClass": false,
5 | "experimental": {
6 | "useFlatConfig": false
7 | },
8 | "codeActionOnSave": {
9 | "mode": "all"
10 | },
11 | "format": false,
12 | "quiet": false,
13 | "onIgnoredFiles": "off",
14 | "options": {},
15 | "rulesCustomizations": [],
16 | "run": "onType",
17 | "problems": {
18 | "shortenToSingleLine": false
19 | },
20 | "nodePath": "",
21 | "codeAction": {
22 | "disableRuleComment": {
23 | "enable": true,
24 | "location": "separateLine",
25 | "commentStyle": "line"
26 | },
27 | "showDocumentation": {
28 | "enable": true
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/docs/user-defined-ls/svelte-language-server.md:
--------------------------------------------------------------------------------
1 | # Svelte Language Server
2 |
3 | https://svelte.dev/
4 |
5 | ## Install the language server
6 |
7 | 1. **Open the New Language Server Dialog**. This can usually be found under the IDE settings related to Language Server Protocol (LSP). For more information, refer to the [New Language Server Dialog documentation](../UserDefinedLanguageServer.md#new-language-server-dialog).
8 |
9 | 2. **Select `Svelte Language Server` as the template** from the available options.
10 | This will populate the command field with a default command. When an astro file will be opened it should install the Svelte LS and Svelte support should be available.
11 |
12 | 
13 |
--------------------------------------------------------------------------------
/docs/user-defined-ls/camel-lsp-server.md:
--------------------------------------------------------------------------------
1 | # Language Server for Apache Camel
2 |
3 | To enable language support for [Apache Camel](https://camel.apache.org/) in your IDE, you can integrate the [Language Server for Apache Camel](https://github.com/camel-tooling/camel-language-server) by following these steps:
4 |
5 | 1. Open `File` -> `Settings`
6 | 2. Go to `Languages & Frameworks` -> `Language Servers`
7 | 3. Click on the `+` button in the right panel, it will open the [New Language Server Dialog](../UserDefinedLanguageServer.md#new-language-server-dialog)
8 | 4. Click `Choose template...`
9 | 5. Select `Camel Language Server`
10 | 6. Click `OK`
11 | 7. Click `OK`
12 | 8. Wait that the server is downloaded (a progress bar will appear in the bottom bar)
13 | 9. Enjoy completion, diagnostics, refactoring and more for your Apache Camel project!
14 |
--------------------------------------------------------------------------------
/increment_version.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Path to your gradle.properties file
4 | GRADLE_PROPERTIES_FILE="gradle.properties"
5 |
6 | # Read the current version from gradle.properties
7 | CURRENT_VERSION=$(grep "pluginVersion=" "$GRADLE_PROPERTIES_FILE" | cut -d'=' -f2)
8 |
9 | # Extract version parts
10 | IFS="-" read -ra VERSION_PARTS <<< "$CURRENT_VERSION"
11 | IFS="." read -ra VERSION_NUM <<< "${VERSION_PARTS[0]}"
12 |
13 | # Increment the last digit
14 | ((VERSION_NUM[2]++))
15 |
16 | # Assemble the new version
17 | NEW_VERSION="${VERSION_NUM[0]}.${VERSION_NUM[1]}.${VERSION_NUM[2]}-SNAPSHOT"
18 |
19 | # Use awk to update the gradle.properties file
20 | awk -v new_version="$NEW_VERSION" '/pluginVersion=/{sub(/=.*/, "=" new_version)}1' "$GRADLE_PROPERTIES_FILE" > tmpfile && mv tmpfile "$GRADLE_PROPERTIES_FILE"
21 |
22 | echo $NEW_VERSION
23 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/launching/FileTypeSettings.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2025 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at https://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.launching;
12 |
13 | /**
14 | * Backward-compatible
15 | */
16 | @Deprecated
17 | public class FileTypeSettings extends com.redhat.devtools.lsp4ij.templates.FileTypeSettings {
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/typescript-language-server/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "completions": {
3 | "completeFunctionCalls": true
4 | },
5 | "typescript": {
6 | "inlayHints": {
7 | "includeInlayEnumMemberValueHints": true,
8 | "includeInlayFunctionLikeReturnTypeHints": true,
9 | "includeInlayFunctionParameterTypeHints": true,
10 | "includeInlayParameterNameHints": "all",
11 | "includeInlayParameterNameHintsWhenArgumentMatchesName": true,
12 | "includeInlayPropertyDeclarationTypeHints": true,
13 | "includeInlayVariableTypeHints": true,
14 | "includeInlayVariableTypeHintsWhenTypeMatchesName": true
15 | },
16 | "implementationsCodeLens": {
17 | "enabled": true
18 | },
19 | "referencesCodeLens": {
20 | "enabled": true,
21 | "showOnAllFunctions": true
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/launching/ServerMappingSettings.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2025 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at https://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.launching;
12 |
13 | /**
14 | * Backward-compatible
15 | */
16 | @Deprecated
17 | public class ServerMappingSettings extends com.redhat.devtools.lsp4ij.templates.ServerMappingSettings {
18 | }
19 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/jdtls/README.md:
--------------------------------------------------------------------------------
1 | You can use the [Eclipse JDT.LS](https://github.com/eclipse-jdtls/eclipse.jdt.ls) to test support for Java files, by
2 | following these instructions:
3 |
4 | * [Download and extract jdt-language-server-latest.tar.gz](https://www.eclipse.org/downloads/download.php?file=/jdtls/snapshots/jdt-language-server-latest.tar.gz)
5 | * Once **jdt-language-server-latest.tar.gz** has been extracted, you need to replace **${BASE_DIR}**.
6 | with the directory where **Eclipse JDT LS** is stored.
7 | * Replace **${DATA_DIR}** with the absolute path to your data directory. Eclipse JDT.LS stores workspace
8 | specific information in it. This should be unique per workspace/project, e.g. `/tmp/jdtls/my-project-name`.
9 |
10 | ⚠️Eclipse JDT.LS requires Java 17 or higher to run, so make sure JAVA_HOME is set to a proper JDK before lauching your
11 | IDE.
12 |
--------------------------------------------------------------------------------
/gradle/libs.versions.toml:
--------------------------------------------------------------------------------
1 | [versions]
2 | # libraries
3 | junit = "4.13.2"
4 | junit-jupiter = "5.10.3"
5 |
6 | # plugins
7 | testlogger = "3.2.0"
8 | kotlin = "2.0.20"
9 | changelog = "2.2.1"
10 | gradleIntelliJPlugin = "2.2.1"
11 | kover = "0.8.3"
12 |
13 | [libraries]
14 | junit = { group = "junit", name = "junit", version.ref = "junit" }
15 | junit-jupiter-api = { group = "org.junit.jupiter", name = "junit-jupiter-api", version.ref = "junit-jupiter" }
16 |
17 | [plugins]
18 | changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
19 | gradleIntelliJPlugin = { id = "org.jetbrains.intellij.platform", version.ref = "gradleIntelliJPlugin" }
20 | kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
21 | testLogger = { id = "com.adarshr.test-logger", version.ref = "testlogger" }
22 | kover = { id = "org.jetbrains.kotlinx.kover", version.ref = "kover" }
23 |
24 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/stylelint-lsp/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "stylelint-lsp",
3 | "name": "Stylelint Language Server",
4 | "programArgs": {
5 | "windows": "cmd /C stylelint-lsp.cmd --stdio",
6 | "default": "sh -c stylelint-lsp --stdio"
7 | },
8 | "expandConfiguration": false,
9 | "fileTypeMappings": [
10 | {
11 | "fileType": {
12 | "name": "CSS",
13 | "patterns": [
14 | "*.css"
15 | ]
16 | },
17 | "languageId": "css"
18 | },
19 | {
20 | "fileType": {
21 | "name": "LESS",
22 | "patterns": [
23 | "*.less"
24 | ]
25 | },
26 | "languageId": "less"
27 | },
28 | {
29 | "fileType": {
30 | "name": "SCSS",
31 | "patterns": [
32 | "*.scss"
33 | ]
34 | },
35 | "languageId": "scss"
36 | }
37 | ]
38 | }
--------------------------------------------------------------------------------
/README_zh.md:
--------------------------------------------------------------------------------
1 | # 项目说明(中文)
2 |
3 | 本仓库基于上游开源项目 redhat-developer/lsp4ij 二次开发,继续遵循 EPL-2.0 许可证,并保留上游版权与许可信息。上游地址与许可证见 NOTICE.md 与 LICENSE。
4 |
5 | ## 新增/调整内容
6 |
7 | - `*.zy` 文件类型与图标:关联到 `ZY` 文件类型,图标位于 `src/main/resources/icons/zy-file.svg`。
8 | - 基础语法高亮(内置):实现 `ZYSimpleLexer`、`ZYSyntaxHighlighter`、`ZYSyntaxHighlighterFactory`,覆盖:
9 | - 关键字(参考根目录 `origami.tmLanguage.json`)
10 | - 字符串与转义、数字
11 | - 变量 `$name`
12 | - 注解 `@Name`
13 | - 类型:内置原始类型与以大写开头的类名
14 | - 函数名:标识符后紧跟 `(` 视为函数
15 | - 运算符:===、!==、==、!=、<=、>=、->、::、??、&&、||、+=、-=、_=、/=、%= 及单字符 + - _ / % = < > . ?
16 |
17 | > 说明:当前为轻量内置 Lexer 方案,未依赖 TextMate;如需更细粒度高亮可后续迭代。
18 |
19 | ## 使用与构建
20 |
21 | - 环境:IntelliJ IDEA 2023.3+,JDK 17+
22 | - 开发与调试:`./gradlew runIde` 启动沙箱 IDE,打开 `*.zy` 查看图标与高亮
23 | - 打包:`./gradlew buildPlugin`,产物位于 `build/distributions`
24 |
25 | ## 许可与致谢
26 |
27 | - 许可证:EPL-2.0,详见 `LICENSE`
28 | - 上游项目与本仓库的新增变更、致谢列表:见 `NOTICE.md`
29 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/sdl-lsp/installer.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "sdl-lsp",
3 | "name": "sdl-lsp",
4 | "executeOnStartServer": false,
5 | "check": {
6 | "exec": {
7 | "name": "Trying current command",
8 | "command": "${server.command}",
9 | "timeout": 2000
10 | }
11 | },
12 | "run": {
13 | "download": {
14 | "name": "Download sdl-lsp",
15 | "url": "https://oss.sonatype.org/content/repositories/snapshots/io/smartdatalake/sdl-lsp/1.0-SNAPSHOT/sdl-lsp-1.0-20250503.111518-23-jar-with-dependencies.jar",
16 | "output": {
17 | "dir": "$USER_HOME$/.lsp4ij/lsp/sdl-lsp"
18 | },
19 | "onSuccess": {
20 | "configureServer": {
21 | "name": "Configure sdl-lsp server command",
22 | "command": "java -jar ${output.dir}/${output.file.name}",
23 | "update": true
24 | }
25 | }
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/clojure-lsp/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "clojure-lsp",
3 | "name": "Clojure LSP",
4 | "programArgs": {
5 | "windows": "\"${BASE_DIR}/clojure-lsp.exe\"",
6 | "default": "\"${BASE_DIR}/clojure-lsp.sh\""
7 | },
8 | "expandConfiguration": true,
9 | "disablePromotionFor": ["com.github.clojure-lsp"],
10 | "fileTypeMappings": [
11 | {
12 | "fileType": {
13 | "name": "Clojure",
14 | "patterns": [
15 | "*.clj",
16 | "*.cljs",
17 | "*.cljc",
18 | "*.cljd",
19 | "*.cljr",
20 | "*.cljx",
21 | "*.clojure",
22 | "*.edn",
23 | "*.joke",
24 | "*.boot",
25 | "*.bb",
26 | "*.ly",
27 | "*.lpy",
28 | "*.calva-repl",
29 | "*.fiddle"
30 | ]
31 | },
32 | "languageId": "clojure"
33 | }
34 | ]
35 | }
--------------------------------------------------------------------------------
/src/test/java/com/redhat/devtools/lsp4ij/features/completion/snippet/handler/LspSnippetNode.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2023 Red Hat Inc. and others.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0 which is available at
6 | * http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
7 | * which is available at https://www.apache.org/licenses/LICENSE-2.0.
8 | *
9 | * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
10 | *
11 | * Contributors:
12 | * Red Hat Inc. - initial API and implementation
13 | *******************************************************************************/
14 | package com.redhat.devtools.lsp4ij.features.completion.snippet.handler;
15 |
16 | public interface LspSnippetNode {
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/get_timestamp_version.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Path to your gradle.properties file
4 | GRADLE_PROPERTIES_FILE="gradle.properties"
5 |
6 | # Read the current version from gradle.properties, ignoring spaces around the equals sign
7 | CURRENT_VERSION=$(grep -E "pluginVersion\s*=\s*" "$GRADLE_PROPERTIES_FILE" | sed -E 's/.*=\s*([^[:space:]]*).*/\1/')
8 |
9 | # Extract the version part before any hyphen
10 | BASE_VERSION=$(echo "$CURRENT_VERSION" | awk -F'-' '{print $1}')
11 |
12 | # Replace any suffix following a hyphen with a timestamp in the format YYYYMMDD-HHmmSS
13 | TIMESTAMP=$(date +'%Y%m%d-%H%M%S')
14 | NEW_VERSION="${BASE_VERSION}-$TIMESTAMP"
15 |
16 | # Use awk to update the gradle.properties file, allowing spaces around the equals sign
17 | awk -v new_version="$NEW_VERSION" '/pluginVersion\s*=\s*/{sub(/=.*/, "=" new_version)}1' "$GRADLE_PROPERTIES_FILE" > tmpfile && mv tmpfile "$GRADLE_PROPERTIES_FILE"
18 |
19 | echo $NEW_VERSION
20 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/ui/LSPToolWindowId.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2025 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at https://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.ui;
12 |
13 | /**
14 | * Tool Window Ids provided by LSP4IJ.
15 | *
16 | */
17 | public interface LSPToolWindowId {
18 |
19 | String LANGUAGE_SERVERS = "Language Servers";
20 |
21 | String SEMANTIC_TOKENS_INSPECTOR = "Semantic Tokens Inspector";
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/docker-language-server/initializationOptions.schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/draft-07/schema#",
3 | "$id": "LSP4IJ/docker-language-server/initializationOptions.schema.json",
4 | "title": "LSP4IJ Docker Language Server server initialization options JSON schema",
5 | "description": "JSON schema for the Docker Language Server's server initialization options.",
6 | "type": "object",
7 | "additionalProperties": false,
8 | "properties": {
9 | "telemetry": {
10 | "type": "string",
11 | "enum": [
12 | "all",
13 | "error",
14 | "off"
15 | ],
16 | "enumDescriptions": [
17 | "All telemetry will be sent",
18 | "Language server errors",
19 | "No telemetry will be sent"
20 | ],
21 | "default": "all",
22 | "description": "Configures what kind of telemetry, if any, should be sent to Docker"
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/vscode-html-language-server/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "vscode-html-language-server",
3 | "name": "HTML Language Server",
4 | "dev": true,
5 | "url": null,
6 | "programArgs": {
7 | "windows": "node \"$USER_HOME$/AppData/Local/Programs/Microsoft VS Code/resources/app/extensions/html-language-features/server/dist/node/htmlServerMain.js\" --stdio",
8 | "mac": "sh -c \"node '/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/html-language-features/server/dist/node/htmlServerMain.js' --stdio\"",
9 | "unix": "sh -c \"node '/usr/share/code/resources/app/extensions/html-language-features/server/dist/node/htmlServerMain.js' --stdio\"",
10 | "default": "sh -c \"node 'resources/app/extensions/html-language-features/server/dist/node/htmlServerMain.js' --stdio\""
11 | },
12 | "languageMappings": [
13 | {
14 | "language": "HTML",
15 | "languageId": "html"
16 | }
17 | ]
18 | }
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/dap/configurations/extractors/PortSegment.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2025 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at https://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.dap.configurations.extractors;
12 |
13 | /**
14 | * The port segment ${port}.
15 | */
16 | public class PortSegment extends DynamicSegment {
17 |
18 | public PortSegment() {
19 | super("${port}", "(\\d+)", DynamicSegmentType.PORT);
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/docker-language-server/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "docker-language-server",
3 | "name": "Docker Language Server",
4 | "programArgs": {
5 | "default": "docker-language-server start --stdio"
6 | },
7 | "languageMappings": [
8 | {
9 | "language": "Dockerfile",
10 | "languageId": "dockerfile"
11 | }
12 | ],
13 | "fileTypeMappings": [
14 | {
15 | "fileType": {
16 | "name": "Docker Compose",
17 | "patterns": [
18 | "compose.yaml",
19 | "compose.yml",
20 | "docker-compose.yml",
21 | "docker-compose.yaml"
22 | ]
23 | },
24 | "languageId": "dockercompose"
25 | },
26 | {
27 | "fileType": {
28 | "name": "Docker Bake",
29 | "patterns": [
30 | "docker-bake.hcl",
31 | "docker-bake.override.hcl"
32 | ]
33 | },
34 | "languageId": "dockerbake"
35 | }
36 | ]
37 | }
38 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/vscode-css-language-server/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "vscode-css-language-server",
3 | "name": "CSS Language Server",
4 | "programArgs": {
5 | "default": "node $USER_HOME$/.lsp4ij/lsp/vscode-css-language-server/node_modules/vscode-langservers-extracted/lib/css-language-server/node/cssServerMain.js --stdio"
6 | },
7 | "expandConfiguration": true,
8 | "fileTypeMappings": [
9 | {
10 | "fileType": {
11 | "name": "CSS",
12 | "patterns": [
13 | "*.css"
14 | ]
15 | },
16 | "languageId": "css"
17 | },
18 | {
19 | "fileType": {
20 | "name": "LESS",
21 | "patterns": [
22 | "*.less"
23 | ]
24 | },
25 | "languageId": "less"
26 | },
27 | {
28 | "fileType": {
29 | "name": "SCSS",
30 | "patterns": [
31 | "*.scss"
32 | ]
33 | },
34 | "languageId": "scss"
35 | }
36 | ]
37 | }
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/LSP4IJWebsiteUrlConstants.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij;
12 |
13 | /**
14 | * LSP4IJ Url documentation
15 | *
16 | * @see LSP4IJ
17 | */
18 | public class LSP4IJWebsiteUrlConstants {
19 |
20 | public static final String FEEDBACK_URL = "https://github.com/redhat-developer/lsp4ij#feedback";
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction0.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction0 extends LSPIntentionAction {
17 | public LSPIntentionAction0() {
18 | super(0);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction1.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction1 extends LSPIntentionAction {
17 | public LSPIntentionAction1() {
18 | super(1);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction2.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction2 extends LSPIntentionAction {
17 | public LSPIntentionAction2() {
18 | super(2);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction3.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction3 extends LSPIntentionAction {
17 | public LSPIntentionAction3() {
18 | super(3);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction4.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction4 extends LSPIntentionAction {
17 | public LSPIntentionAction4() {
18 | super(4);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction5.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction5 extends LSPIntentionAction {
17 | public LSPIntentionAction5() {
18 | super(5);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction6.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction6 extends LSPIntentionAction {
17 | public LSPIntentionAction6() {
18 | super(6);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction7.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction7 extends LSPIntentionAction {
17 | public LSPIntentionAction7() {
18 | super(7);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction8.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction8 extends LSPIntentionAction {
17 | public LSPIntentionAction8() {
18 | super(8);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction9.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction9 extends LSPIntentionAction {
17 | public LSPIntentionAction9() {
18 | super(9);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/server/LanguageServerLogErrorHandler.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at https://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.server;
12 |
13 | /**
14 | * Language server error handler.
15 | */
16 | public interface LanguageServerLogErrorHandler {
17 |
18 | /**
19 | * Log the given error.
20 | *
21 | * @param error the language server error.
22 | */
23 | void logError(String error);
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/dap/configurations/extractors/AddressSegment.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2025 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at https://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.dap.configurations.extractors;
12 |
13 | /**
14 | * The address segment ${address}.
15 | */
16 | public class AddressSegment extends DynamicSegment {
17 |
18 | public AddressSegment() {
19 | super("${address}", "([\\w\\.]+)", DynamicSegmentType.ADDRESS);
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction10.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction10 extends LSPIntentionAction {
17 | public LSPIntentionAction10() {
18 | super(10);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction11.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction11 extends LSPIntentionAction {
17 | public LSPIntentionAction11() {
18 | super(11);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction12.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction12 extends LSPIntentionAction {
17 | public LSPIntentionAction12() {
18 | super(12);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction13.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction13 extends LSPIntentionAction {
17 | public LSPIntentionAction13() {
18 | super(13);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction14.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction14 extends LSPIntentionAction {
17 | public LSPIntentionAction14() {
18 | super(14);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction15.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction15 extends LSPIntentionAction {
17 | public LSPIntentionAction15() {
18 | super(15);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction16.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction16 extends LSPIntentionAction {
17 | public LSPIntentionAction16() {
18 | super(16);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction17.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction17 extends LSPIntentionAction {
17 | public LSPIntentionAction17() {
18 | super(17);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction18.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction18 extends LSPIntentionAction {
17 | public LSPIntentionAction18() {
18 | super(18);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/codeAction/intention/LSPIntentionAction19.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.codeAction.intention;
12 |
13 | /**
14 | * LSP {@link com.intellij.codeInsight.intention.IntentionAction} at given index.
15 | */
16 | public class LSPIntentionAction19 extends LSPIntentionAction {
17 | public LSPIntentionAction19() {
18 | super(19);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/dap/configurations/options/ServerTraceConfigurable.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2025 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at https://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.dap.configurations.options;
12 |
13 | import com.redhat.devtools.lsp4ij.settings.ServerTrace;
14 |
15 | /**
16 | * Server trace configurable.
17 | */
18 | public interface ServerTraceConfigurable {
19 |
20 | ServerTrace getServerTrace();
21 |
22 | void setServerTrace(ServerTrace serverTrace);
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/internal/PsiFileChangedException.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2025 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at https://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.internal;
12 |
13 | import java.util.concurrent.CancellationException;
14 |
15 | /**
16 | * Psi file changed exception
17 | */
18 | public class PsiFileChangedException extends CancellationException {
19 |
20 | public PsiFileChangedException() {
21 | super("Psi file has changed.");
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/internal/editor/EditorFeatureType.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at https://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.internal.editor;
12 |
13 | import org.jetbrains.annotations.ApiStatus;
14 |
15 | /**
16 | * The editor feature type ro refresh.
17 | */
18 | @ApiStatus.Internal
19 | public enum EditorFeatureType {
20 | CODE_VISION,
21 | DECLARATIVE_INLAY_HINT,
22 | INLAY_HINT,
23 | FOLDING,
24 | ALL
25 | }
26 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/ada_language_server/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "ada_language_server",
3 | "name": "Ada Language Server",
4 | "programArgs": {
5 | "windows": "\"${BASE_DIR}/ada_language_server.exe\"",
6 | "default": "\"${BASE_DIR}/ada_language_server\""
7 | },
8 | "expandConfiguration": true,
9 | "fileTypeMappings": [
10 | {
11 | "fileType": {
12 | "name": "Ada",
13 | "patterns": [
14 | "*.ada",
15 | "*.adb",
16 | "*.adc",
17 | "*.ads"
18 | ]
19 | },
20 | "languageId": "ada"
21 | },
22 | {
23 | "fileType": {
24 | "name": "Ada Library Information",
25 | "patterns": [
26 | "*.ali"
27 | ]
28 | },
29 | "languageId": "ali"
30 | },
31 | {
32 | "fileType": {
33 | "name": "GNAT Project",
34 | "patterns": [
35 | "*.gpr"
36 | ]
37 | },
38 | "languageId": "gpr"
39 | }
40 | ]
41 | }
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/metals/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "metals.disableReleaseNotes": false,
3 | "metals.enableBestEffort": false,
4 | "metals.serverVersion": "1.5.3",
5 | "metals.serverProperties": [
6 | "-Xmx2G",
7 | "-XX:+UseZGC",
8 | "-XX:ZUncommitDelay\u003d30",
9 | "-XX:ZCollectionInterval\u003d5",
10 | "-XX:+IgnoreUnrecognizedVMOptions"
11 | ],
12 | "metals.excludedPackages": [],
13 | "metals.javaVersion": "17",
14 | "metals.superMethodLensesEnabled": true,
15 | "metals.enableStripMarginOnTypeFormatting": true,
16 | "metals.enableIndentOnPaste": false,
17 | "metals.verboseCompilation": false,
18 | "metals.enableSemanticHighlighting": true,
19 | "metals.testUserInterface": "Test Explorer",
20 | "metals.customProjectRoot": "",
21 | "metals.fallbackScalaVersion": "automatic",
22 | "metals.suggestLatestUpgrade": false,
23 | "metals.defaultBspToBuildTool": false,
24 | "metals.autoImportBuilds": "off",
25 | "metals.startMcpServer": false
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/internal/telemetry/NoOpTelemetryService.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat Inc. and others.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0 which is available at
6 | * http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
7 | * which is available at https://www.apache.org/licenses/LICENSE-2.0.
8 | *
9 | * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
10 | *
11 | * Contributors:
12 | * Red Hat Inc. - initial API and implementation
13 | *******************************************************************************/
14 | package com.redhat.devtools.lsp4ij.internal.telemetry;
15 |
16 | import com.redhat.devtools.lsp4ij.telemetry.TelemetryService;
17 |
18 | /**
19 | * No-Op implementation of telemetry service
20 | */
21 | public class NoOpTelemetryService implements TelemetryService {
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/client/ExecuteLSPFeatureStatus.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at https://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.client;
12 |
13 | /**
14 | * Execute LSP feature status
15 | */
16 | public enum ExecuteLSPFeatureStatus {
17 |
18 | NOW, // The LSP feature can be executed now for a given file.
19 | AFTER_INDEXING, // The LSP feature can be executed for a given file after the indexing project
20 | NOT // The LSP feature cannot be executed for a given file.
21 | }
22 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/filetypes/ZYLanguage.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2025 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at https://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.filetypes;
12 |
13 | import com.intellij.lang.Language;
14 |
15 | /**
16 | * Language definition for ZY language.
17 | */
18 | public class ZYLanguage extends Language {
19 |
20 | /**
21 | * Singleton instance of the ZY language.
22 | */
23 | public static final ZYLanguage INSTANCE = new ZYLanguage();
24 |
25 | protected ZYLanguage() {
26 | super("ZY");
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/camel-lsp-server/installer.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "camel-lsp-server",
3 | "name": "Camel Language Server",
4 | "executeOnStartServer": false,
5 | "check": {
6 | "exec": {
7 | "name": "Trying current command",
8 | "command": "${server.command}",
9 | "timeout": 2000
10 | }
11 | },
12 | "run": {
13 | "download": {
14 | "name": "Download Camel Language Server",
15 | "maven": {
16 | "groupId": "com.github.camel-tooling",
17 | "artifactId": "camel-lsp-server"
18 | },
19 | "url": "https://repo1.maven.org/maven2/com/github/camel-tooling/camel-lsp-server/1.31.0/camel-lsp-server-1.31.0.jar",
20 | "output": {
21 | "dir": "$USER_HOME$/.lsp4ij/lsp/camel-lsp-server"
22 | },
23 | "onSuccess": {
24 | "configureServer": {
25 | "name": "Configure Camel Language Server command",
26 | "command": "java -jar ${output.dir}/${output.file.name}",
27 | "update": true
28 | }
29 | }
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/settings/ErrorReportingKind.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.settings;
12 |
13 | /**
14 | * Language server error reporting kind.
15 | */
16 | public enum ErrorReportingKind {
17 | none, // ignore language server errors
18 | as_notification, // report error in an IJ notification
19 | in_log; // report error in the log
20 |
21 | public static ErrorReportingKind getDefaultValue() {
22 | return as_notification;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/jdtls/installer.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "jdt-ls",
3 | "name": "jdt-ls",
4 | "check": {
5 | "exec": {
6 | "name": "Trying current command",
7 | "command": "${server.command}",
8 | "timeout": 2000
9 | }
10 | },
11 | "run": {
12 | "download": {
13 | "name": "Download jdt-ls",
14 | "url": "https://www.eclipse.org/downloads/download.php?file=/jdtls/snapshots/jdt-language-server-latest.tar.gz",
15 | "output": {
16 | "dir": "$USER_HOME$/.lsp4ij/lsp/jdt-ls",
17 | "file": {
18 | "name": {
19 | "windows": "bin/jdtls.bat",
20 | "default": "bin/jdtls"
21 | },
22 | "executable": true
23 | }
24 | },
25 | "onSuccess": {
26 | "configureServer": {
27 | "name": "Configure jdt-ls server command",
28 | "command": "\"${output.dir}/${output.file.name}\" -configuration \"$USER_HOME$/.cache/jdtls\" -data \"$PROJECT_DIR$/jdtls-data\"",
29 | "update": true
30 | }
31 | }
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/src/main/resources/templates/dap/vscode-js-debug/installer.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "vscode-js-debug-installer",
3 | "name": "vscode-js-debug",
4 | "check": {
5 | "exec": {
6 | "name": "Trying current command",
7 | "command": "${server.command}",
8 | "timeout": 2000
9 | }
10 | },
11 | "run": {
12 | "download": {
13 | "name": "Download vscode-js-debug",
14 | "github": {
15 | "owner": "microsoft",
16 | "repository": "vscode-js-debug",
17 | "prerelease": false,
18 | "asset": "js-debug-dap-*.tar.gz"
19 | },
20 | "url": "https://github.com/microsoft/vscode-js-debug/releases/download/v1.100.1/js-debug-dap-v1.100.1.tar.gz",
21 | "output": {
22 | "dir": "$USER_HOME$/.lsp4ij/dap/vscode-js-debug"
23 | },
24 | "onSuccess": {
25 | "configureServer": {
26 | "name": "Configure VSCode JS Debug server command",
27 | "command": "node ${output.dir}/src/dapDebugServer.js ${port} 127.0.0.1",
28 | "update": true
29 | }
30 | }
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/typescript-language-server/README.md:
--------------------------------------------------------------------------------
1 | You can use the [TypeScript language server](https://github.com/typescript-language-server/typescript-language-server) by following these instructions:
2 | * [Install Node.js](https://nodejs.org/en/download)
3 | * [Read the "Installing" section](https://github.com/typescript-language-server/typescript-language-server?tab=readme-ov-file#installing), basically, open a terminal and execute the following command:
4 |
5 | **npm install -g typescript-language-server typescript**
6 |
7 | It will install:
8 |
9 | * [TypeScript language server](https://github.com/typescript-language-server/typescript-language-server). This project
10 | delegates the LSP operations (completion, diagnostics, etc) to the **tsserver** from [TypeScript](https://github.com/microsoft/TypeScript)
11 | which doesn't support LSP.
12 | * [TypeScript](https://github.com/microsoft/TypeScript) which hosts the **tsserver**.
13 | * As the command will add **typescript-language-server** in your OS PATH, you will have to close and reopen your IntelliJ to update this PATH.
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/client/features/LSPClientFeatureAware.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2025 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 |
12 | package com.redhat.devtools.lsp4ij.client.features;
13 |
14 | import org.jetbrains.annotations.NotNull;
15 |
16 | /**
17 | * LSP client features aware.
18 | */
19 | public interface LSPClientFeatureAware {
20 |
21 | /**
22 | * Set the LSP client features.
23 | *
24 | * @param clientFeatures the LSP client features.
25 | */
26 | void setClientFeatures(@NotNull LSPClientFeatures clientFeatures);
27 | }
28 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/dap/configurations/options/AttachConfigurable.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2025 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at https://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.dap.configurations.options;
12 |
13 | import org.jetbrains.annotations.Nullable;
14 |
15 | /**
16 | * Attach configurable.
17 | */
18 | public interface AttachConfigurable {
19 |
20 | @Nullable String getAttachAddress();
21 |
22 | void setAttachAddress(@Nullable String attachAddress);
23 |
24 | @Nullable String getAttachPort();
25 |
26 | void setAttachPort(@Nullable String attachPort);
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/inspections/AbstractDelegateInspection.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2023 Red Hat Inc. and others.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0 which is available at
6 | * http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
7 | * which is available at https://www.apache.org/licenses/LICENSE-2.0.
8 | *
9 | * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
10 | *
11 | * Contributors:
12 | * Red Hat Inc. - initial API and implementation
13 | *******************************************************************************/
14 | package com.redhat.devtools.lsp4ij.inspections;
15 |
16 | import com.intellij.codeInspection.LocalInspectionTool;
17 |
18 | /**
19 | * No-op {@link LocalInspectionTool} used as a basis for mapping inspection severities to matching LSP severities.
20 | */
21 | public abstract class AbstractDelegateInspection extends LocalInspectionTool {
22 | }
23 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/server/CannotStartServerException.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2023 Red Hat Inc. and others.
3 | *
4 | * This program and the accompanying materials are made available under the
5 | * terms of the Eclipse Public License v. 2.0 which is available at
6 | * http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
7 | * which is available at https://www.apache.org/licenses/LICENSE-2.0.
8 | *
9 | * SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
10 | *
11 | * Contributors:
12 | * Red Hat Inc. - initial API and implementation
13 | *******************************************************************************/
14 | package com.redhat.devtools.lsp4ij.server;
15 |
16 | /**
17 | * Language server exception when language server cannot be done.
18 | */
19 | public class CannotStartServerException extends LanguageServerException {
20 |
21 | public CannotStartServerException(String message, Throwable e) {
22 | super(message, e);
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/semanticTokens/inspector/SemanticTokensInspectorListener.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.semanticTokens.inspector;
12 |
13 | /**
14 | * Semantic tokens inspector listener.
15 | */
16 | public interface SemanticTokensInspectorListener {
17 |
18 | /**
19 | * Callback called when a new semantic tokens is consumes for a given file.
20 | *
21 | * @param data the semantic inspector data.
22 | */
23 | void notify(SemanticTokensInspectorData data);
24 | }
25 |
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/workspaceSymbol/LSPWorkspaceGotoSymbolContributor.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at https://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.workspaceSymbol;
12 |
13 | import org.jetbrains.annotations.NotNull;
14 |
15 | /**
16 | * LSP workspace goto symbol contributor.
17 | */
18 | public class LSPWorkspaceGotoSymbolContributor extends AbstractLSPWorkspaceSymbolContributor {
19 |
20 | @Override
21 | protected @NotNull LSPWorkspaceSymbolParams createWorkspaceSymbolParams(@NotNull String query) {
22 | return new LSPWorkspaceSymbolParams(query);
23 | }
24 | }
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/features/workspaceSymbol/LSPWorkspaceGotoClassContributor.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2024 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at https://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.features.workspaceSymbol;
12 |
13 | import org.jetbrains.annotations.NotNull;
14 |
15 | /**
16 | * LSP workspace goto class contributor.
17 | */
18 | public class LSPWorkspaceGotoClassContributor extends AbstractLSPWorkspaceSymbolContributor {
19 |
20 | @Override
21 | protected @NotNull LSPWorkspaceSymbolParams createWorkspaceSymbolParams(@NotNull String query) {
22 | return new LSPWorkspaceSymbolForClassesParams(query);
23 | }
24 | }
--------------------------------------------------------------------------------
/src/main/resources/templates/dap/vscode-js-debug/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "vscode-js-debug",
3 | "name": "VSCode JS Debug",
4 | "launch": {
5 | "default": "node <>/js-debug/src/dapDebugServer.js ${port} 127.0.0.1"
6 | },
7 | "debugServerReadyPattern": "Debug server listening at ",
8 | "attach": {
9 | "port": "$port"
10 | },
11 | "fileTypeMappings": [
12 | {
13 | "fileType": {
14 | "name": "JavaScript"
15 | },
16 | "languageId": "javascript"
17 | },
18 | {
19 | "fileType": {
20 | "name": "JavaScript-React",
21 | "patterns": [
22 | "*.jsx"
23 | ]
24 | },
25 | "languageId": "javascriptreact"
26 | },
27 | {
28 | "fileType": {
29 | "name": "TypeScript",
30 | "patterns": [
31 | "*.ts"
32 | ]
33 | },
34 | "languageId": "typescript"
35 | },
36 | {
37 | "fileType": {
38 | "name": "TypeScript-React",
39 | "patterns": [
40 | "*.tsx"
41 | ]
42 | },
43 | "languageId": "typescriptreact"
44 | }
45 | ]
46 | }
--------------------------------------------------------------------------------
/src/main/resources/templates/lsp/sourcekit-lsp/README.md:
--------------------------------------------------------------------------------
1 | To enable Swift language support in your IDE, you can integrate [SourceKit-LSP](https://github.com/swiftlang/sourcekit-lsp) by following these steps:
2 |
3 | 1. Install Swift. Please see the [Getting Started Guide on Swift.org](https://www.swift.org/getting-started/) for details on how to install Swift on your system.
4 | This installation will install the [SourceKit-LSP](https://github.com/swiftlang/sourcekit-lsp) language server.
5 |
6 | 2. **Open the New Language Server Dialog**. This can usually be found under the IDE settings related to Language Server Protocol (LSP).
7 | For more information, refer to the [New Language Server Dialog documentation](../UserDefinedLanguageServer.md#new-language-server-dialog).
8 |
9 | 3. **Select SourceKit-LSP as the template** from the available options.
10 | This will populate the command field with a default command `sourcekit-lsp`
11 |
12 | 4. **Optional**: You may also customize the mappings section according to your preferences.
13 |
14 | 5. **Click OK** to apply the changes. You should now have Swift language support enabled in your IDE.
--------------------------------------------------------------------------------
/src/main/java/com/redhat/devtools/lsp4ij/dap/DebugMode.java:
--------------------------------------------------------------------------------
1 | /*******************************************************************************
2 | * Copyright (c) 2025 Red Hat, Inc.
3 | * Distributed under license by Red Hat, Inc. All rights reserved.
4 | * This program is made available under the terms of the
5 | * Eclipse Public License v2.0 which accompanies this distribution,
6 | * and is available at http://www.eclipse.org/legal/epl-v20.html
7 | *
8 | * Contributors:
9 | * Red Hat, Inc. - initial API and implementation
10 | ******************************************************************************/
11 | package com.redhat.devtools.lsp4ij.dap;
12 |
13 | import org.jetbrains.annotations.NotNull;
14 |
15 | /**
16 | * The debug mode ("launch", "attach").
17 | */
18 | public enum DebugMode {
19 |
20 | LAUNCH,
21 | ATTACH;
22 |
23 | @NotNull
24 | public static DebugMode get(String value) {
25 | try {
26 | return DebugMode.valueOf(value.toUpperCase());
27 | }
28 | catch(Exception e) {
29 | return DebugMode.LAUNCH;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------