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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cpplite/cpplite.editor/licenseinfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
<license ref="MIT-cpp-textmate-grammars" />
<comment type="COMMENT_UNSUPPORTED">Source: https://github.com/jeff-hykin/cpp-textmate-grammar</comment>
</fileset>
<fileset>
<file>src/org/netbeans/modules/cpplite/editor/file/resources/language-configuration.json</file>
<license ref="MIT-vscode" />
<comment type="COMMENT_UNSUPPORTED">Source: https://github.com/microsoft/vscode/blob/main/extensions/cpp/language-configuration.json</comment>
</fileset>
<fileset>
<file>src/org/netbeans/modules/cpplite/editor/file/resources/CCSrcIcon.gif</file>
<file>src/org/netbeans/modules/cpplite/editor/file/resources/HDataIcon.gif</file>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.netbeans.api.annotations.common.StaticResource;
import org.netbeans.core.spi.multiview.MultiViewElement;
import org.netbeans.core.spi.multiview.text.MultiViewEditorElement;
import org.netbeans.modules.lsp.client.api.LanguageConfigurationRegistration;
import org.netbeans.modules.textmate.lexer.api.GrammarRegistration;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
Expand Down Expand Up @@ -115,6 +116,7 @@
)
})
@GrammarRegistration(grammar="resources/c.tmLanguage.json", mimeType=MIMETypes.C)
@LanguageConfigurationRegistration(languageConfiguration="resources/language-configuration.json", mimeType=MIMETypes.C)
public class CDataObject extends MultiDataObject {

@StaticResource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.netbeans.api.annotations.common.StaticResource;
import org.netbeans.core.spi.multiview.MultiViewElement;
import org.netbeans.core.spi.multiview.text.MultiViewEditorElement;
import org.netbeans.modules.lsp.client.api.LanguageConfigurationRegistration;
import org.netbeans.modules.textmate.lexer.api.GrammarRegistration;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
Expand Down Expand Up @@ -115,6 +116,7 @@
)
})
@GrammarRegistration(grammar="resources/cpp.tmLanguage.json", mimeType=MIMETypes.CPP)
@LanguageConfigurationRegistration(languageConfiguration="resources/language-configuration.json", mimeType=MIMETypes.CPP)
public class CPPDataObject extends MultiDataObject {

@StaticResource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.netbeans.api.annotations.common.StaticResource;
import org.netbeans.core.spi.multiview.MultiViewElement;
import org.netbeans.core.spi.multiview.text.MultiViewEditorElement;
import org.netbeans.modules.lsp.client.api.LanguageConfigurationRegistration;
import org.netbeans.modules.textmate.lexer.api.GrammarRegistration;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
Expand Down Expand Up @@ -115,6 +116,7 @@
)
})
@GrammarRegistration(grammar="resources/c.tmLanguage.json", mimeType=MIMETypes.H)
@LanguageConfigurationRegistration(languageConfiguration="resources/language-configuration.json", mimeType=MIMETypes.H)
public class HDataObject extends MultiDataObject {

@StaticResource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.netbeans.api.annotations.common.StaticResource;
import org.netbeans.core.spi.multiview.MultiViewElement;
import org.netbeans.core.spi.multiview.text.MultiViewEditorElement;
import org.netbeans.modules.lsp.client.api.LanguageConfigurationRegistration;
import org.netbeans.modules.textmate.lexer.api.GrammarRegistration;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
Expand Down Expand Up @@ -115,6 +116,7 @@
)
})
@GrammarRegistration(grammar="resources/cpp.tmLanguage.json", mimeType=MIMETypes.HPP)
@LanguageConfigurationRegistration(languageConfiguration="resources/language-configuration.json", mimeType=MIMETypes.HPP)
public class HPPDataObject extends MultiDataObject {

@StaticResource
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"comments": {
"lineComment": "//",
"blockComment": [
"/*",
"*/"
]
},
"brackets": [
[
"{",
"}"
],
[
"[",
"]"
],
[
"(",
")"
]
],
"autoClosingPairs": [
{
"open": "[",
"close": "]"
},
{
"open": "{",
"close": "}"
},
{
"open": "(",
"close": ")"
},
{
"open": "'",
"close": "'",
"notIn": [
"string",
"comment"
]
},
{
"open": "\"",
"close": "\"",
"notIn": [
"string"
]
},
{
"open": "/*",
"close": "*/",
"notIn": [
"string",
"comment"
]
},
{
"open": "/**",
"close": " */",
"notIn": [
"string"
]
}
],
"surroundingPairs": [
[
"{",
"}"
],
[
"[",
"]"
],
[
"(",
")"
],
[
"\"",
"\""
],
[
"'",
"'"
],
[
"<",
">"
]
],
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)",
"folding": {
"markers": {
"start": "^\\s*#\\s*pragma\\s+region\\b",
"end": "^\\s*#\\s*pragma\\s+endregion\\b"
}
},
"indentationRules": {
"decreaseIndentPattern": {
"pattern": "^\\s*[\\}\\]\\)].*$"
},
"increaseIndentPattern": {
"pattern": "^.*(\\{[^}]*|\\([^)]*|\\[[^\\]]*)$"
},
},
"onEnterRules": [
{
// Decrease indentation after single line if/else if/else, for, or while
"previousLineText": "^\\s*(((else ?)?if|for|while)\\s*\\(.*\\)\\s*|else\\s*)$",
// But make sure line doesn't have braces or is not another if statement
"beforeText": "^\\s+([^{i\\s]|i(?!f\\b))",
"action": {
"indent": "outdent"
}
},
// Add // when pressing enter from inside line comment
{
"beforeText": "^\\s*//\\s*\\S|\\s//\\s+\\S",
"afterText": "^(?!\\s*$)",
"action": {
"indent": "none",
"appendText": "// "
}
},
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
under the License.

-->
<project basedir="." default="build" name="enterprise/libs.jackson">
<project basedir="." default="build" name="ide/libs.jackson">
<import file="../../nbbuild/templates/projectized.xml"/>
</project>
File renamed without changes.
17 changes: 16 additions & 1 deletion ide/lsp.client/apichanges.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,27 @@
under the License.

-->
<!DOCTYPE apichanges PUBLIC "-//NetBeans//DTD API changes list 1.0//EN" "../../nbbuild/javadoctools/apichanges.dtd">
<!DOCTYPE apichanges PUBLIC "-//NetBeans//DTD API changes list 1.1//EN" "../../nbbuild/javadoctools/apichanges-1.1.dtd">
<apichanges>
<apidefs>
<apidef name="lsp_client">LSP Client API</apidef>
</apidefs>
<changes>
<change id="LanguageConfigurationJSON">
<api name="lsp_client" />
<summary>Adding LanguageIdProvider</summary>
<version major="0" minor="1.38" />
<date day="2" month="11" year="2026" />
<author login="jlahoda" />
<compatibility addition="yes" binary="compatible" source="compatible" />
<description>
<p>
Basic support for language-configuration.json added.
</p>
</description>
<class name="LanguageFeatures" package="org.netbeans.modules.lsp.client.api"/>
<class name="LanguageConfiguration" package="org.netbeans.modules.lsp.client.spi"/>
</change>
<change id="LanguageIdProvider">
<api name="lsp_client" />
<summary>Adding LanguageIdProvider</summary>
Expand Down
5 changes: 5 additions & 0 deletions ide/lsp.client/licenseinfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,9 @@
<license ref="Apache-2.0-ASF" />
<comment type="COMMENT_UNSUPPORTED" />
</fileset>
<fileset>
<file>test/unit/src/org/netbeans/modules/lsp/client/bindings/configuration/c.tmLanguage.json</file>
<license ref="MIT-cpp-textmate-grammars" />
<comment type="COMMENT_UNSUPPORTED">Source: https://github.com/jeff-hykin/cpp-textmate-grammar</comment>
</fileset>
</licenseinfo>
3 changes: 2 additions & 1 deletion ide/lsp.client/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
javac.release=17
javac.compilerargs=-Xlint -Xlint:-serial
javadoc.arch=${basedir}/arch.xml
javadoc.apichanges=${basedir}/apichanges.xml
release.external/org.eclipse.lsp4j-0.24.0.jar=modules/ext/org.eclipse.lsp4j-0.24.0.jar
release.external/org.eclipse.lsp4j.generator-0.24.0.jar=modules/ext/org.eclipse.lsp4j.generator-0.24.0.jar
release.external/org.eclipse.lsp4j.jsonrpc-0.24.0.jar=modules/ext/org.eclipse.lsp4j.jsonrpc-0.24.0.jar
Expand All @@ -26,4 +27,4 @@ release.external/org.eclipse.lsp4j.jsonrpc.debug-0.24.0.jar=modules/ext/org.ecli
release.external/org.eclipse.xtend.lib-2.32.0.jar=modules/ext/org.eclipse.xtend.lib-2.32.0.jar
release.external/org.eclipse.xtend.lib.macro-2.32.0.jar=modules/ext/org.eclipse.xtend.lib.macro-2.32.0.jar
release.external/org.eclipse.xtext.xbase.lib-2.32.0.jar=modules/ext/org.eclipse.xtext.xbase.lib-2.32.0.jar
spec.version.base=1.37.0
spec.version.base=1.38.0
22 changes: 22 additions & 0 deletions ide/lsp.client/nbproject/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@
<specification-version>1.0</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.netbeans.libs.jackson</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<release-version>2</release-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.netbeans.modules.editor</code-name-base>
<build-prerequisite/>
Expand All @@ -111,6 +119,15 @@
<specification-version>1.90</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.netbeans.modules.editor.bracesmatching</code-name-base>
<build-prerequisite/>
<compile-dependency/>
<run-dependency>
<release-version>0</release-version>
<specification-version>1.72</specification-version>
</run-dependency>
</dependency>
<dependency>
<code-name-base>org.netbeans.modules.editor.breadcrumbs</code-name-base>
<build-prerequisite/>
Expand Down Expand Up @@ -445,6 +462,10 @@
<recursive/>
<compile-dependency/>
</test-dependency>
<test-dependency>
<code-name-base>org.netbeans.modules.lexer.nbbridge</code-name-base>
<compile-dependency/>
</test-dependency>
<test-dependency>
<code-name-base>org.netbeans.modules.masterfs</code-name-base>
<compile-dependency/>
Expand Down Expand Up @@ -474,6 +495,7 @@
</test-type>
</test-dependencies>
<public-packages>
<package>org.netbeans.modules.lsp.client.api</package>
<package>org.netbeans.modules.lsp.client.debugger.api</package>
<package>org.netbeans.modules.lsp.client.debugger.spi</package>
<package>org.netbeans.modules.lsp.client.spi</package>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.netbeans.modules.lsp.client.api;

import java.lang.annotation.ElementType;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Target;

/**Register a {@code language-configuration.json} for a given mime type.
*
* Will also register language features defined in {@link LanguageFeatures}
* as appropriate.
*
* @since 1.38
*/
@Repeatable(LanguageConfigurationRegistrations.class)
@Target({ElementType.PACKAGE, ElementType.TYPE})
public @interface LanguageConfigurationRegistration {
/** The mime-type under which the grammar should be registered.
*
* @return mime-type
*/
public String mimeType();

/** The language configuration to register.
*
* @return language configuration
*/
public String languageConfiguration();

}
Loading
Loading