├── .actrc ├── .gitattributes ├── .github ├── dependabot.yml └── workflows │ ├── build.yml │ └── licensecheck.yml ├── .gitignore ├── .mvn ├── extensions.xml └── wrapper │ └── maven-wrapper.properties ├── .project ├── CHANGELOG.md ├── CONTRIBUTING.md ├── Jenkinsfile ├── LICENSE ├── README.md ├── documentation ├── integrating-a-language-server.md ├── troubleshooting-language-servers.md ├── using-built-in-debug-adapter-launch-configuration.md └── using-language-server-via-configuration-no-code.md ├── mvnw ├── mvnw.cmd ├── org.eclipse.lsp4e.debug ├── .classpath ├── .options ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.launching.prefs │ └── org.eclipse.jdt.ui.prefs ├── EPL-2.0.html ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── examples │ ├── .gitignore │ ├── .project │ ├── .vscode │ │ ├── launch.json │ │ └── settings.json │ ├── Launch (C++).launch │ ├── Launch (Mock).launch │ ├── Launch (Python).launch │ ├── Makefile │ ├── hello.py │ ├── main.c │ └── readme.md ├── forceQualifierUpdate.properties ├── icons │ ├── pda.gif │ └── view16 │ │ └── debugger_tab.gif ├── plugin.xml └── src │ └── org │ └── eclipse │ └── lsp4e │ └── debug │ ├── DSPImages.java │ ├── DSPPlugin.java │ ├── breakpoints │ ├── DSPBreakpointAdapter.java │ ├── DSPLineBreakpoint.java │ ├── TextSelectionToIVariable.java │ ├── ToggleBreakpointsTargetFactory.java │ └── package-info.java │ ├── console │ ├── DSPProcess.java │ ├── DSPStreamMonitor.java │ ├── DSPStreamsProxy.java │ └── package-info.java │ ├── debugmodel │ ├── DSPBreakpointManager.java │ ├── DSPDebugElement.java │ ├── DSPDebugTarget.java │ ├── DSPStackFrame.java │ ├── DSPThread.java │ ├── DSPValue.java │ ├── DSPVariable.java │ ├── JsonParserWithStringSubstitution.java │ ├── TraceInputStream.java │ ├── TraceOutputStream.java │ ├── TransportStreams.java │ └── package-info.java │ ├── launcher │ ├── DSPLaunchDelegate.java │ ├── DSPMainTab.java │ ├── DSPOverrideSettingsTab.java │ ├── DSPTabGroup.java │ └── package-info.java │ ├── package-info.java │ ├── presentation │ ├── DAPWatchExpression.java │ ├── DSPDebugModelPresentation.java │ └── package-info.java │ └── sourcelookup │ ├── AbsolutePathSourceContainer.java │ ├── DSPSourceLookupDirector.java │ ├── DSPSourceLookupParticipant.java │ ├── DSPSourcePathComputerDelegate.java │ └── package-info.java ├── org.eclipse.lsp4e.jdt ├── .classpath ├── .project ├── .settings │ └── org.eclipse.jdt.core.prefs ├── EPL-2.0.html ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── plugin.properties ├── plugin.xml └── src │ └── org │ └── eclipse │ └── lsp4e │ └── jdt │ ├── JavaSemanticTokensProcessor.java │ ├── LSJavaCompletionProposalComputer.java │ ├── LSJavaCompletionWrappingCompletionProposal.java │ ├── LSJavaHoverProvider.java │ ├── LSJavaProposal.java │ ├── LSJavaSemanticTokensProvider.java │ ├── LanguageServerJdtPlugin.java │ ├── LspJavaQuickAssistProcessor.java │ ├── Messages.java │ ├── messages.properties │ ├── package-info.java │ └── preferences │ ├── LspJdtPreferencesPage.java │ ├── LspJdtPrefsInitializer.java │ └── PreferenceConstants.java ├── org.eclipse.lsp4e.test ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.jdt.ui.prefs ├── EPL-2.0.html ├── META-INF │ └── MANIFEST.MF ├── build.properties ├── fragment.xml ├── pom.xml └── src │ ├── jul.properties │ └── org │ └── eclipse │ └── lsp4e │ └── test │ ├── ContentTypeToLanguageServerDefinitionTest.java │ ├── LanguageServerWrapperTest.java │ ├── LanguageServersTest.java │ ├── LanguageServiceAccessorTest.java │ ├── RunningLanguageServerTest.java │ ├── VersioningSupportTest.java │ ├── WorkspaceFoldersTest.java │ ├── callhierarchy │ └── CallHierarchyLabelProviderTest.java │ ├── codeactions │ └── CodeActionTests.java │ ├── color │ └── ColorTest.java │ ├── commands │ └── DynamicRegistrationTest.java │ ├── completion │ ├── AbstractCompletionTest.java │ ├── CompleteCompletionTest.java │ ├── CompletionOrderingTests.java │ ├── ContextInformationTest.java │ ├── IncompleteCompletionTest.java │ ├── InsertReplaceCompletionTest.java │ ├── ScoreOfFilterMatchTest.java │ └── VariableReplacementTest.java │ ├── debug │ ├── DebugTest.java │ └── debugmodel │ │ └── JsonParserWithStringSubstitutionTest.java │ ├── declaration │ └── LSBasedHyperlinkTest.java │ ├── definition │ └── DefinitionTest.java │ ├── diagnostics │ └── DiagnosticsTest.java │ ├── documentLink │ ├── DocumentLinkReconcilingTest.java │ └── DocumentLinkTest.java │ ├── edit │ ├── DocumentDidChangeTest.java │ ├── DocumentDidCloseTest.java │ ├── DocumentDidOpenTest.java │ ├── DocumentDidSaveTest.java │ ├── DocumentEditAndUndoTest.java │ ├── DocumentRevertAndCloseTest.java │ ├── DocumentWillSaveWaitUntilTest.java │ └── LSPEclipseUtilsTest.java │ ├── folding │ └── FoldingTest.java │ ├── format │ └── FormatTest.java │ ├── highlight │ └── HighlightTest.java │ ├── hover │ └── HoverTest.java │ ├── internal │ ├── CharsInputStreamTest.java │ ├── DocumentInputStreamTest.java │ └── HumanFriendlyComparatorTest.java │ ├── linkedediting │ └── LinkedEditingTest.java │ ├── message │ └── ShowMessageTest.java │ ├── operations │ ├── codelens │ │ └── LSPCodeMiningTest.java │ └── inlayhint │ │ └── LSPLineContentCodeMiningTest.java │ ├── outline │ ├── EditorToOutlineAdapterFactoryTest.java │ ├── OutlineContentTest.java │ └── SymbolsLabelProviderTest.java │ ├── references │ └── FindReferencesTest.java │ ├── rename │ ├── LSPTextChangeTest.java │ └── RenameTest.java │ ├── semanticTokens │ ├── SemanticHighlightReconcilerStrategyTest.java │ ├── SemanticTokensDataStreamProcessorTest.java │ ├── SemanticTokensLegendProviderTest.java │ ├── SemanticTokensTestUtil.java │ ├── StyleRangeHolderTest.java │ ├── StyleRangeMergerTest.java │ └── rust.tmLanguage.json │ ├── symbols │ └── SymbolsModelTest.java │ └── utils │ ├── AbstractTest.java │ ├── AbstractTestWithProject.java │ ├── AllCleanRule.java │ ├── BlockingWorkspaceJob.java │ ├── CreateAndRegisterContentTypeLSPLaunchConfigMapping.java │ ├── MappingEnablementTester.java │ ├── MockConnectionProviderWithException.java │ ├── NoErrorLoggedRule.java │ ├── OtherFileStore.java │ ├── OtherFileSystem.java │ ├── TestInfoRule.java │ ├── TestUtils.java │ └── UriToResourceAdapterFactory.java ├── org.eclipse.lsp4e.tests.mock ├── .classpath ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ └── org.eclipse.jdt.ui.prefs ├── EPL-2.0.html ├── META-INF │ └── MANIFEST.MF ├── build.properties └── src │ └── org │ └── eclipse │ └── lsp4e │ └── tests │ └── mock │ ├── MockConnectionProvider.java │ ├── MockConnectionProviderMultiRootFolders.java │ ├── MockLanguageServer.java │ ├── MockLanguageServerMultiRootFolders.java │ ├── MockTextDocumentService.java │ └── MockWorkspaceService.java ├── org.eclipse.lsp4e ├── .classpath ├── .gitignore ├── .options ├── .project ├── .settings │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ └── org.eclipse.pde.core.prefs ├── EPL-2.0.html ├── META-INF │ └── MANIFEST.MF ├── OSGI-INF │ └── org.eclipse.lsp4e.format.DefaultFormatRegionsProvider.xml ├── build.properties ├── icons │ └── full │ │ ├── dlcl16 │ │ ├── alphab_sort_co.png │ │ ├── alphab_sort_co@2x.png │ │ ├── call_hierarchy.gif │ │ ├── fields_co.png │ │ ├── link_to_editor.png │ │ ├── link_to_editor@2x.png │ │ └── type_hierarchy.gif │ │ ├── elcl16 │ │ ├── alphab_sort_co.png │ │ ├── alphab_sort_co@2x.png │ │ ├── fields_co.png │ │ ├── link_to_editor.png │ │ ├── link_to_editor@2x.png │ │ ├── sub_co.png │ │ ├── sub_co@2x.png │ │ ├── super_co.png │ │ └── super_co@2x.png │ │ └── obj16 │ │ ├── array.png │ │ ├── array@2.png │ │ ├── boolean.png │ │ ├── boolean@2x.png │ │ ├── class.png │ │ ├── class@2x.png │ │ ├── constant.png │ │ ├── constant@2x.png │ │ ├── constructor.png │ │ ├── constructor@2x.png │ │ ├── enum.png │ │ ├── enum@2x.png │ │ ├── enum_member.png │ │ ├── enum_member@2x.png │ │ ├── field.png │ │ ├── field@2x.png │ │ ├── function.png │ │ ├── function@2x.png │ │ ├── interface.png │ │ ├── interface@2x.png │ │ ├── keyword.png │ │ ├── keyword@2x.png │ │ ├── method.png │ │ ├── method@2x.png │ │ ├── module.png │ │ ├── module@2x.png │ │ ├── namespace.png │ │ ├── namespace@2x.png │ │ ├── null.png │ │ ├── null@2x.png │ │ ├── number.png │ │ ├── number@2x.png │ │ ├── object.png │ │ ├── object@2.png │ │ ├── package.png │ │ ├── package@2x.png │ │ ├── property.png │ │ ├── property@2x.png │ │ ├── reference.png │ │ ├── reference@2x.png │ │ ├── snippet.png │ │ ├── snippet@2x.png │ │ ├── struct.png │ │ ├── struct@2x.png │ │ ├── terminate_co.png │ │ ├── terminate_co@2x.png │ │ ├── text.png │ │ ├── text@2x.png │ │ ├── type_parameter.png │ │ ├── type_parameter@2x.png │ │ ├── unit.png │ │ ├── unit@2x.png │ │ ├── value.png │ │ ├── value@2x.png │ │ ├── variable.png │ │ └── variable@2x.png ├── plugin.properties ├── plugin.xml ├── pom.xml ├── resources │ └── css │ │ └── dark.css ├── schema │ └── languageServer.exsd └── src │ └── org │ └── eclipse │ └── lsp4e │ ├── ConnectDocumentToLanguageServerSetupParticipant.java │ ├── ContentTypeToLSPLaunchConfigEntry.java │ ├── ContentTypeToLanguageServerDefinition.java │ ├── DocumentContentSynchronizer.java │ ├── HasLanguageServerPropertyTester.java │ ├── IMarkerAttributeComputer.java │ ├── LSPEclipseUtils.java │ ├── LanguageClientImpl.java │ ├── LanguageServerPlugin.java │ ├── LanguageServerWrapper.java │ ├── LanguageServers.java │ ├── LanguageServersRegistry.java │ ├── LanguageServiceAccessor.java │ ├── LaunchConfigurationStreamProvider.java │ ├── LoggingStreamConnectionProviderProxy.java │ ├── ServerMessageHandler.java │ ├── Versioned.java │ ├── VersionedEdits.java │ ├── callhierarchy │ ├── CallHierarchyCommandHandler.java │ ├── CallHierarchyContentProvider.java │ ├── CallHierarchyLabelProvider.java │ ├── CallHierarchyView.java │ ├── CallHierarchyViewTreeNode.java │ └── package-info.java │ ├── client │ ├── DefaultLanguageClient.java │ └── package-info.java │ ├── command │ ├── CommandExecutor.java │ ├── LSPCommandHandler.java │ ├── internal │ │ ├── CommandConverter.java │ │ ├── CommandEventParameter.java │ │ ├── PathConverter.java │ │ └── package-info.java │ └── package-info.java │ ├── enablement │ ├── EnablementTester.java │ └── package-info.java │ ├── format │ ├── DefaultFormatRegionsProvider.java │ ├── DocumentFormatOnTypeAutoEditStrategy.java │ ├── IFormatRegionsProvider.java │ └── package-info.java │ ├── internal │ ├── ArrayUtil.java │ ├── CancellationSupport.java │ ├── CancellationUtil.java │ ├── CharsInputStream.java │ ├── DocumentInputStream.java │ ├── DocumentUtil.java │ ├── FileBufferListenerAdapter.java │ ├── HumanFriendlyComparator.java │ ├── LSPDocumentAbstractHandler.java │ ├── NullSafetyHelper.java │ ├── Pair.java │ ├── ResourceForUriCache.java │ ├── StyleUtil.java │ ├── SupportedFeatures.java │ ├── ThrowingConsumer.java │ ├── ThrowingPredicate.java │ └── package-info.java │ ├── operations │ ├── codeactions │ │ ├── CodeActionCompletionProposal.java │ │ ├── CodeActionMarkerResolution.java │ │ ├── CommandMarkerResolution.java │ │ ├── LSPCodeActionMarkerResolution.java │ │ ├── LSPCodeActionQuickAssistProcessor.java │ │ ├── LSPCodeActionsMenu.java │ │ └── package-info.java │ ├── codelens │ │ ├── CodeLensProvider.java │ │ ├── LSPCodeMining.java │ │ └── package-info.java │ ├── color │ │ ├── ColorInformationMining.java │ │ ├── DocumentColorProvider.java │ │ └── package-info.java │ ├── completion │ │ ├── CompletionProposalTools.java │ │ ├── CompletionSnippetParser.java │ │ ├── LSCompletionProposal.java │ │ ├── LSCompletionProposalComparator.java │ │ ├── LSContentAssistProcessor.java │ │ └── package-info.java │ ├── declaration │ │ ├── LSBasedHyperlink.java │ │ ├── OpenDeclarationHyperlinkDetector.java │ │ └── package-info.java │ ├── diagnostics │ │ ├── DiagnosticAnnotation.java │ │ ├── LSPDiagnosticsToMarkers.java │ │ └── package-info.java │ ├── documentLink │ │ ├── DocumentLinkDetector.java │ │ ├── LSPDocumentLinkPresentationReconcilingStrategy.java │ │ └── package-info.java │ ├── folding │ │ ├── LSPFoldingReconcilingStrategy.java │ │ └── package-info.java │ ├── format │ │ ├── LSPFormatFilesHandler.java │ │ ├── LSPFormatHandler.java │ │ ├── LSPFormatter.java │ │ └── package-info.java │ ├── highlight │ │ ├── HighlightReconcilingStrategy.java │ │ └── package-info.java │ ├── hover │ │ ├── FocusableBrowserInformationControl.java │ │ ├── LSPTextHover.java │ │ └── package-info.java │ ├── inlayhint │ │ ├── InlayHintProvider.java │ │ ├── LSPLineContentCodeMining.java │ │ └── package-info.java │ ├── linkedediting │ │ ├── LSPLinkedEditingBase.java │ │ ├── LSPLinkedEditingReconcilingStrategy.java │ │ └── package-info.java │ ├── references │ │ ├── FileAndURIMatchContentProvider.java │ │ ├── FileAndURIMatchLabelProvider.java │ │ ├── LSFindReferences.java │ │ ├── LSSearchQuery.java │ │ ├── LSSearchResult.java │ │ ├── LSSearchResultPage.java │ │ ├── URIMatch.java │ │ └── package-info.java │ ├── rename │ │ ├── LSPRenameHandler.java │ │ ├── LSPRenameProcessor.java │ │ ├── LSPRenameRefactoringWizard.java │ │ └── package-info.java │ ├── selectionRange │ │ ├── LSPSelectionRangeAbstractHandler.java │ │ ├── LSPSelectionRangeDownHandler.java │ │ ├── LSPSelectionRangeUpHandler.java │ │ └── package-info.java │ ├── semanticTokens │ │ ├── AbstractcSemanticTokensDataStreamProcessor.java │ │ ├── SemanticHighlightReconcilerStrategy.java │ │ ├── SemanticTokensClient.java │ │ ├── SemanticTokensDataStreamProcessor.java │ │ ├── StyleRangeHolder.java │ │ ├── StyleRangeMerger.java │ │ ├── TokenTypeMapper.java │ │ ├── VersionedSemanticTokens.java │ │ └── package-info.java │ ├── symbols │ │ ├── LSPSymbolInFileDialog.java │ │ ├── LSPSymbolInFileHandler.java │ │ ├── LSPSymbolInWorkspaceDialog.java │ │ ├── LSPSymbolInWorkspaceHandler.java │ │ ├── WorkspaceSymbolQuickAccessElement.java │ │ ├── WorkspaceSymbolsQuickAccessProvider.java │ │ └── package-info.java │ └── typeHierarchy │ │ ├── TypeHierarchyContentProvider.java │ │ ├── TypeHierarchyDialog.java │ │ ├── TypeHierarchyHandler.java │ │ ├── TypeHierarchyItemLabelProvider.java │ │ ├── TypeHierarchyView.java │ │ ├── TypeHierarchyViewContentProvider.java │ │ ├── TypeHierarchyViewHandler.java │ │ ├── TypeMemberContentProvider.java │ │ └── package-info.java │ ├── outline │ ├── CNFOutlinePage.java │ ├── CollapseAllOutlineHandler.java │ ├── EditorToOutlineAdapterFactory.java │ ├── HasCNFOutlinePage.java │ ├── LSSymbolsContentProvider.java │ ├── OutlineSorter.java │ ├── OutlineViewHideSymbolKindMenuContributor.java │ ├── ShowKindHandler.java │ ├── SymbolInformationPropertyTester.java │ ├── SymbolsLabelProvider.java │ ├── SymbolsModel.java │ ├── ToggleHideFieldsOutlineHandler.java │ ├── ToggleLinkingHandler.java │ ├── ToggleSortOutlineHandler.java │ └── package-info.java │ ├── package-info.java │ ├── progress │ ├── LSPProgressManager.java │ └── package-info.java │ ├── refactoring │ ├── CreateFileChange.java │ ├── DeleteExternalFile.java │ ├── LSPTextChange.java │ └── package-info.java │ ├── server │ ├── ProcessOverSocketStreamConnectionProvider.java │ ├── ProcessStreamConnectionProvider.java │ ├── StreamConnectionProvider.java │ └── package-info.java │ └── ui │ ├── EnableDisableLSJob.java │ ├── FoldingPreferencePage.java │ ├── LSPImages.java │ ├── LanguageServerPreferencePage.java │ ├── LanguageServersView.java │ ├── LoggingPreferencePage.java │ ├── Messages.java │ ├── NewContentTypeLSPLaunchDialog.java │ ├── UI.java │ ├── messages.properties │ ├── package-info.java │ └── views │ ├── HierarchyViewInput.java │ └── package-info.java ├── pom.xml ├── repository ├── .gitignore ├── category.xml ├── deploy-settings.xml └── pom.xml ├── svg └── org.eclipse.languageserver │ └── icons │ └── full │ ├── elcl16 │ └── link_to_editor.svg │ ├── etool16 │ └── mark_occurrences.svg │ └── obj16 │ ├── boolean.svg │ ├── class.svg │ ├── constant.svg │ ├── constructor.svg │ ├── enum.svg │ ├── field.svg │ ├── function.svg │ ├── interface.svg │ ├── keyword.svg │ ├── method.svg │ ├── module.svg │ ├── namespace.svg │ ├── null.svg │ ├── number.svg │ ├── package.svg │ ├── property.svg │ ├── reference.svg │ ├── snippet.svg │ ├── text.svg │ ├── unit.svg │ ├── value.svg │ └── variable.svg └── target-platforms └── target-platform-latest ├── .project └── target-platform-latest.target /.actrc: -------------------------------------------------------------------------------- 1 | # config file for https://github.com/nektos/act 2 | --matrix os:ubuntu-latest 3 | -W .github/workflows/build.yml 4 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # based on https://github.com/alexkaratarakis/gitattributes/ 2 | 3 | # Handle line endings automatically for files detected as text 4 | # and leave all files detected as binary untouched. 5 | * text=auto 6 | 7 | # 8 | # The above will handle all files NOT found below 9 | # 10 | # These files are text and should be normalized (Convert crlf => lf) 11 | *.gitattributes text 12 | .gitignore text 13 | *.bash text eol=lf 14 | *.bat text eol=crlf 15 | *.cmd text eol=crlf 16 | *.css text diff=css 17 | *.exsd text 18 | *.htm text diff=html 19 | *.html text diff=html 20 | *.ini text 21 | *.md text diff=markdown 22 | *.java text diff=java 23 | *.js text 24 | *.json text 25 | *.properties text 26 | *.sh text 27 | *.tmLanguage text 28 | *.ts text 29 | *.txt text 30 | *.xsd text 31 | *.xml text 32 | *.yaml text 33 | *.yml text 34 | MANIFEST.MF text 35 | Dockerfile text eol=lf 36 | Jenkinsfile text 37 | LICENSE text 38 | 39 | # These files are binary and should be left untouched 40 | # (binary is a macro for -text -diff) 41 | *.gif binary 42 | *.ico binary 43 | *.jpeg binary 44 | *.jpg binary 45 | *.png binary 46 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 2 | version: 2 3 | updates: 4 | - package-ecosystem: github-actions 5 | directory: / 6 | schedule: 7 | interval: daily 8 | commit-message: 9 | prefix: ci 10 | prefix-development: ci 11 | include: scope 12 | 13 | # Separated roots are subject to be replaced with the single '/'-root directory as soon as 14 | # https://github.com/dependabot/dependabot-core/issues/4364 issue is fixed 15 | - package-ecosystem: maven 16 | directory: /org.eclipse.lsp4e 17 | schedule: 18 | interval: daily 19 | commit-message: 20 | prefix: fix 21 | prefix-development: build 22 | include: scope 23 | labels: 24 | - dependencies 25 | 26 | - package-ecosystem: maven 27 | directory: /org.eclipse.lsp4e.test 28 | schedule: 29 | interval: daily 30 | commit-message: 31 | prefix: fix 32 | prefix-development: build 33 | include: scope 34 | labels: 35 | - dependencies 36 | 37 | - package-ecosystem: maven 38 | directory: /repository 39 | schedule: 40 | interval: daily 41 | commit-message: 42 | prefix: fix 43 | prefix-development: build 44 | include: scope 45 | labels: 46 | - dependencies 47 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Local work folder that is not checked in 2 | _LOCAL/ 3 | 4 | # Eclipse 5 | /bin/ 6 | /*/bin/ 7 | **/.settings/* 8 | !**/.settings/org.eclipse.core.resoures.prefs 9 | !**/.settings/org.eclipse.jdt.core.prefs 10 | !**/.settings/org.eclipse.pde.core.prefs 11 | **/.pydevproject 12 | 13 | # Maven 14 | /target/ 15 | /*/target/ 16 | .polyglot.* 17 | .META-INF_MANIFEST.MF 18 | **/.tycho-consumer-pom.xml 19 | dash-licenses/ 20 | *.log 21 | 22 | # OSX 23 | .DS_Store 24 | 25 | # Vim 26 | *.swo 27 | *.swp 28 | -------------------------------------------------------------------------------- /.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | org.eclipse.tycho 5 | tycho-build 6 | 4.0.13 7 | 8 | 9 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | wrapperVersion=3.3.2 18 | distributionType=only-script 19 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip 20 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | lsp4e 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.m2e.core.maven2Builder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.m2e.core.maven2Nature 16 | 17 | 18 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | options { 3 | timeout(time: 15, unit: 'MINUTES') 4 | buildDiscarder(logRotator(numToKeepStr: '10')) 5 | disableConcurrentBuilds(abortPrevious: true) 6 | } 7 | 8 | agent { 9 | label 'centos-latest' 10 | } 11 | 12 | tools { 13 | jdk 'temurin-jdk17-latest' 14 | } 15 | 16 | stages { 17 | 18 | stage('Build') { 19 | steps { 20 | wrap([$class: 'Xvnc', useXauthority: true]) { 21 | sh """ 22 | ./mvnw clean verify \ 23 | org.eclipse.dash:license-tool-plugin:license-check \ 24 | -B ${env.BRANCH_NAME=='main' ? '-Psign': ''} \ 25 | -Dmaven.test.failure.ignore=true \ 26 | -Ddash.fail=false \ 27 | -Dsurefire.rerunFailingTestsCount=3 28 | """ 29 | } 30 | } 31 | post { 32 | always { 33 | archiveArtifacts artifacts: 'repository/target/repository/**/*,repository/target/*.zip,*/target/work/data/.metadata/.log' 34 | junit '*/target/surefire-reports/TEST-*.xml' 35 | } 36 | } 37 | } 38 | 39 | stage('Deploy Snapshot') { 40 | when { 41 | branch 'main' 42 | } 43 | steps { 44 | sshagent (['projects-storage.eclipse.org-bot-ssh']) { 45 | sh ''' 46 | DOWNLOAD_AREA=/home/data/httpd/download.eclipse.org/lsp4e/snapshots/ 47 | echo DOWNLOAD_AREA=$DOWNLOAD_AREA 48 | ssh genie.lsp4e@projects-storage.eclipse.org "\ 49 | rm -rf ${DOWNLOAD_AREA}/* && \ 50 | mkdir -p ${DOWNLOAD_AREA}" 51 | scp -r repository/target/repository/* genie.lsp4e@projects-storage.eclipse.org:${DOWNLOAD_AREA} 52 | ''' 53 | } 54 | } 55 | } 56 | 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /documentation/integrating-a-language-server.md: -------------------------------------------------------------------------------- 1 | ## Properly integrating a language server with LSP4E 2 | 3 | ### General principle 4 | 5 | Use the `org.eclipse.lsp4e.languageServer` extension in `plugin.xml` to define a language server (ie how to start it and connect to it) and to associate it with one or many content-types. 6 | 7 | ### Examples 8 | 9 | See [multiple examples in the test](../org.eclipse.lsp4e.test/plugin.xml). 10 | 11 | ### Tips and Tricks 12 | 13 | * Use the `ProcessStreamConnectionProvider` if your LS is accessible as a process. 14 | 15 | * To handle LSP Commands (e.g. associated with `CodeLens` messages) in the IDE, register a sub-class of `org.eclipse.lsp4e.command.LSPCommandHandler` in the `plugin.xml` file of your plug-in via the `org.eclipse.ui.handlers` extension. The handler has to be registered for the `commandId` equal to the `Command.command` attribute of an LSP message. Note that client side handlers will not be triggered, if the language server is capable of executing commands of the same `commandId`. -------------------------------------------------------------------------------- /documentation/troubleshooting-language-servers.md: -------------------------------------------------------------------------------- 1 | ## Troubleshooting language servers with LSP4E 2 | 3 | ### Log and analyze LSP messages 4 | 5 | In the vast majority of cases, when troubleshooting a Language Server integration, the unique source of truth are the LSP messages that are exchanged between the IDE (Eclipse IDE with LSP4E here) and the language server. 6 | 7 | LSP4E allows to easily get those messages, in both directions, logged in a file. To get it, go to _Preferences > Language Servers > Logs_ and find the interesting Language Server to inspect. Then double click on the `Log to file` column to enable logging. A popup will suggest that you restart the IDE, but what you can simply close all files associated to the target Language Server and reopen them, what matters isn't that the IDE restarts, but more that the Language Server restarts. 8 | 9 | Then in the _/languageServers-log_ folder, you'll see files containing the raw messages and a timestamp. You can then inspect for typical cause of failures such as: 10 | * an expected message was not sent or received 11 | * a message contains an erroneous value 12 | * a message doesn't receive a response in due time 13 | * ... 14 | 15 | ### Debug the language server 16 | 17 | TODO -------------------------------------------------------------------------------- /documentation/using-built-in-debug-adapter-launch-configuration.md: -------------------------------------------------------------------------------- 1 | ## Use built-in Debug Adapter launch Configuration 2 | 3 | There are two sort of use cases in which it is very interesting: 4 | 5 | * A Debug Adapter Server is available. It allows remote connection or can be launched locally. No specific Eclipse integration has been provided. 6 | * During the development of a Debug Adapter Server. 7 | 8 | 9 | ### Use Case 1: use an existing Debug Adapter Server 10 | 11 | Steps to use launch configuration: 12 | 13 | * In `Run configuration`, select `Debug Adapter launcher` then click `New` button. 14 | * Provide information to either start the Debug Adapter Server or connect to it. 15 | * Fill the launch parameters as Json. It is the ones which are sent during [`launch request`](https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Launch). 16 | 17 | ### Use Case 2: develop a Debug Adapter Server 18 | 19 | When starting the development of a Debug Adapter Server, using the built-in Debug Adapter launch configuration avoids the requirement to provide a specific Eclipse plugin. It will be possible to provide it later. 20 | 21 | The `monitor Debug Adapter launcher process` option is very useful, it allows to track the communication between the client and the server. 22 | 23 | By default, the `launch` option for the Application Under Debug is used. In case, the Application Under Debug is already running and the goal is to `attach`, you need to add `"request": "attach"` in the `Launch parameters as Json`. 24 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/.options: -------------------------------------------------------------------------------- 1 | # Debugging options for the org.eclipse.lsp4e.debug plug-in 2 | 3 | org.eclipse.lsp4e.debug/debug= false 4 | 5 | # Tracing of data to/from the debug adapter at the IO level. 6 | # This will trace the data to System.out as it is seen on the IO stream. 7 | org.eclipse.lsp4e.debug/trace/io= false 8 | # Tracing of data to/from the debug adapter at the message level. 9 | # This will trace parsed data, reformed into JSON-RPC 2.0 to System.out. 10 | org.eclipse.lsp4e.debug/trace/messages= false 11 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.eclipse.lsp4e.debug 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/.settings/org.eclipse.jdt.launching.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.launching.PREF_COMPILER_COMPLIANCE_DOES_NOT_MATCH_JRE=warning 3 | org.eclipse.jdt.launching.PREF_STRICTLY_COMPATIBLE_JRE_NOT_AVAILABLE=warning 4 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Debug Adapter client for Eclipse IDE (Incubation) 4 | Bundle-SymbolicName: org.eclipse.lsp4e.debug;singleton:=true 5 | Bundle-Vendor: Eclipse LSP4E 6 | Bundle-Version: 0.15.15.qualifier 7 | Bundle-Activator: org.eclipse.lsp4e.debug.DSPPlugin 8 | Require-Bundle: org.eclipse.ui, 9 | org.eclipse.core.runtime, 10 | org.eclipse.debug.core, 11 | org.eclipse.debug.ui, 12 | org.eclipse.jface, 13 | org.eclipse.lsp4j.jsonrpc;bundle-version="[0.24.0,0.25.0)", 14 | org.eclipse.lsp4j.jsonrpc.debug;bundle-version="[0.24.0,0.25.0)", 15 | org.eclipse.lsp4j.debug;bundle-version="[0.24.0,0.25.0)", 16 | org.eclipse.ui.editors, 17 | org.eclipse.core.filesystem, 18 | org.eclipse.ui.ide;bundle-version="[3.16.0,4.0.0)", 19 | org.eclipse.jface.text, 20 | org.eclipse.ui.genericeditor, 21 | org.eclipse.core.variables, 22 | org.eclipse.lsp4e;bundle-version="0.18.13" 23 | Bundle-RequiredExecutionEnvironment: JavaSE-17 24 | Bundle-ActivationPolicy: lazy 25 | Import-Package: com.google.gson, 26 | com.google.gson.reflect;version="2.7.0" 27 | Export-Package: org.eclipse.lsp4e.debug;x-internal:=true, 28 | org.eclipse.lsp4e.debug.breakpoints;x-internal:=true, 29 | org.eclipse.lsp4e.debug.console;x-internal:=true, 30 | org.eclipse.lsp4e.debug.debugmodel;x-friends:="org.eclipse.lsp4e.test", 31 | org.eclipse.lsp4e.debug.launcher, 32 | org.eclipse.lsp4e.debug.presentation;x-internal:=true, 33 | org.eclipse.lsp4e.debug.sourcelookup;x-internal:=true 34 | Automatic-Module-Name: org.eclipse.lsp4e.debug 35 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | plugin.xml,\ 6 | EPL-2.0.html,\ 7 | .options,\ 8 | icons/ 9 | 10 | # JDT Null Analysis for Eclipse 11 | additional.bundles = org.eclipse.jdt.annotation,\ 12 | com.vegardit.no-npe.eea-all 13 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/examples/.gitignore: -------------------------------------------------------------------------------- 1 | main 2 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/examples/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | debugprotocolexamples 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/examples/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2017 Kichwa Coders Ltd. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | { 10 | "version": "0.2.0", 11 | "configurations": [ 12 | { 13 | "name": "Integrated Terminal/Console", 14 | "type": "python", 15 | "request": "launch", 16 | "stopOnEntry": true, 17 | "program": "${workspaceRoot}/hello.py", 18 | "cwd": "", 19 | "console": "integratedTerminal", 20 | "env": {} 21 | }, 22 | { 23 | "name": "(gdb) Launch", 24 | "type": "cppdbg", 25 | "request": "launch", 26 | "program": "${workspaceRoot}/main", 27 | "args": [], 28 | "stopAtEntry": false, 29 | "cwd": "${workspaceRoot}", 30 | "environment": [], 31 | "externalConsole": true, 32 | "MIMode": "gdb", 33 | "setupCommands": [ 34 | { 35 | "description": "Enable pretty-printing for gdb", 36 | "text": "-enable-pretty-printing", 37 | "ignoreFailures": true 38 | } 39 | ] 40 | }, 41 | { 42 | "type": "mock", 43 | "request": "launch", 44 | "name": "Mock Debug", 45 | "program": "${workspaceRoot}/readme.md", 46 | "trace": true 47 | } 48 | ] 49 | } -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/examples/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "stdio.h": "c" 4 | } 5 | } -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/examples/Launch (C++).launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/examples/Launch (Mock).launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/examples/Launch (Python).launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/examples/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | gcc -Wall -pthread -g -o main main.c 3 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/examples/hello.py: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Copyright (c) 2017 Kichwa Coders Ltd. and others. 3 | # This program and the accompanying materials are made 4 | # available under the terms of the Eclipse Public License 2.0 5 | # which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | # 7 | # SPDX-License-Identifier: EPL-2.0 8 | ################################################################################ 9 | print("Hello1") 10 | print("Hello2") 11 | print("Hello3") 12 | print("Hello4") 13 | print("Hello5") 14 | for i in range(100): 15 | print("Hello %s" % i) 16 | print("Hello1") 17 | print("Hello2") 18 | print("Hello3") 19 | print("Hello4") 20 | print("Hello5") 21 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/examples/main.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2017 Kichwa Coders Ltd. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | 16 | #define FOREVER 17 | #define NUMTHREADS 3 18 | 19 | pthread_t tid[NUMTHREADS]; 20 | int threadNums[NUMTHREADS]; 21 | 22 | void *doSomeThing(void *arg) { 23 | int threadNum = *(int *)arg; 24 | printf("Running thread %d\n", threadNum); 25 | 26 | // Fake some work 27 | for (int i = 0; i < 0xfffffff; i++) 28 | ; 29 | 30 | printf("Finishing thread %d\n", threadNum); 31 | return NULL; 32 | } 33 | 34 | int main(void) { 35 | int err = setvbuf(stdout, NULL, _IONBF, 0); 36 | if (err != 0) { 37 | printf("Failed to setvbuf: %s\n", strerror(err)); 38 | } 39 | 40 | #ifdef FOREVER 41 | while (1) { 42 | #endif 43 | for (int i = 0; i < NUMTHREADS; i++) { 44 | threadNums[i] = i; 45 | int err = pthread_create(&tid[i], NULL, &doSomeThing, &threadNums[i]); 46 | if (err != 0) { 47 | printf("Failed to create thread %d: %s\n", i, strerror(err)); 48 | } else { 49 | printf("Created thread %d\n", i); 50 | } 51 | } 52 | 53 | printf("Joining threads\n"); 54 | for (int i = 0; i < NUMTHREADS; i++) { 55 | int err = pthread_join(tid[i], NULL); 56 | if (err != 0) { 57 | printf("Failed to join thread %d: %s\n", i, strerror(err)); 58 | } else { 59 | printf("Joined thread %d\n", i); 60 | } 61 | } 62 | #ifdef FOREVER 63 | printf("Sleeping before restarting.\n"); 64 | sleep(3); 65 | } 66 | #endif 67 | 68 | 69 | printf("Main thread done\n"); 70 | return 0; 71 | } 72 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/examples/readme.md: -------------------------------------------------------------------------------- 1 | ## Examples for lsp4e.debug 2 | 3 | This project contains launch settings to launch the following debug adapters: 4 | 5 | - Mock Debug -- https://marketplace.visualstudio.com/items?itemName=andreweinand.mock-debug 6 | - Python -- https://marketplace.visualstudio.com/items?itemName=ms-python.python 7 | - C/C++ -- https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools 8 | 9 | Each of the examples has settings for launching in VS Code's launch.json, plus launch configurations for LSP4E.Debug. 10 | 11 | You will most probably need to update the paths to files within the various launch files depending on where you clone this repo. 12 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/forceQualifierUpdate.properties: -------------------------------------------------------------------------------- 1 | Bump qualifier so sources are published. -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/icons/pda.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e.debug/icons/pda.gif -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/icons/view16/debugger_tab.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e.debug/icons/view16/debugger_tab.gif -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/breakpoints/DSPLineBreakpoint.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2017 Kichwa Coders Ltd. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.debug.breakpoints; 10 | 11 | import org.eclipse.core.resources.IMarker; 12 | import org.eclipse.core.resources.IResource; 13 | import org.eclipse.core.runtime.CoreException; 14 | import org.eclipse.debug.core.model.IBreakpoint; 15 | import org.eclipse.debug.core.model.LineBreakpoint; 16 | import org.eclipse.lsp4e.debug.DSPPlugin; 17 | 18 | public class DSPLineBreakpoint extends LineBreakpoint { 19 | 20 | public static final String ID = "org.eclipse.lsp4e.debug.breakpoints.markerType.lineBreakpoint"; 21 | 22 | public DSPLineBreakpoint() { 23 | } 24 | 25 | public DSPLineBreakpoint(final IResource resource, final int lineNumber) throws CoreException { 26 | run(getMarkerRule(resource), monitor -> { 27 | IMarker marker = resource.createMarker(ID); 28 | setMarker(marker); 29 | marker.setAttribute(IBreakpoint.ENABLED, Boolean.TRUE); 30 | marker.setAttribute(IMarker.LINE_NUMBER, lineNumber); 31 | marker.setAttribute(IBreakpoint.ID, getModelIdentifier()); 32 | marker.setAttribute(IMarker.MESSAGE, resource.getName() + " [line: " + lineNumber + "]"); 33 | }); 34 | } 35 | 36 | public DSPLineBreakpoint(final IResource resource, String fileName, final int lineNumber) throws CoreException { 37 | run(getMarkerRule(resource), monitor -> { 38 | IMarker marker = resource.createMarker(ID); 39 | setMarker(marker); 40 | marker.setAttribute(IBreakpoint.ENABLED, Boolean.TRUE); 41 | marker.setAttribute(IMarker.LINE_NUMBER, lineNumber); 42 | marker.setAttribute(IBreakpoint.ID, getModelIdentifier()); 43 | marker.setAttribute(IMarker.MESSAGE, resource.getName() + " [line: " + lineNumber + "]"); 44 | }); 45 | } 46 | 47 | @Override 48 | public String getModelIdentifier() { 49 | return DSPPlugin.ID_DSP_DEBUG_MODEL; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/breakpoints/ToggleBreakpointsTargetFactory.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Kichwa Coders Canada Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.debug.breakpoints; 10 | 11 | import java.util.Collections; 12 | import java.util.Set; 13 | 14 | import org.eclipse.debug.ui.actions.IToggleBreakpointsTarget; 15 | import org.eclipse.debug.ui.actions.IToggleBreakpointsTargetFactory; 16 | import org.eclipse.jdt.annotation.Nullable; 17 | import org.eclipse.jface.viewers.ISelection; 18 | import org.eclipse.lsp4e.debug.DSPPlugin; 19 | import org.eclipse.ui.IWorkbenchPart; 20 | 21 | public class ToggleBreakpointsTargetFactory implements IToggleBreakpointsTargetFactory { 22 | 23 | private static final DSPBreakpointAdapter DSP_BREAKPOINT_ADAPTER = new DSPBreakpointAdapter(); 24 | 25 | public static final String TOGGLE_BREAKPOINT_TARGET_ID = DSPPlugin.PLUGIN_ID + ".toggleBreakpointTarget"; //$NON-NLS-1$ 26 | 27 | private static final Set TOGGLE_TARGET_IDS = Collections.singleton(TOGGLE_BREAKPOINT_TARGET_ID); 28 | 29 | @Override 30 | public Set getToggleTargets(IWorkbenchPart part, ISelection selection) { 31 | return TOGGLE_TARGET_IDS; 32 | } 33 | 34 | @Override 35 | public @Nullable String getDefaultToggleTarget(IWorkbenchPart part, ISelection selection) { 36 | return null; 37 | } 38 | 39 | @Override 40 | public @Nullable IToggleBreakpointsTarget createToggleTarget(String targetID) { 41 | if (TOGGLE_BREAKPOINT_TARGET_ID.equals(targetID)) { 42 | return DSP_BREAKPOINT_ADAPTER; 43 | } 44 | return null; 45 | } 46 | 47 | @Override 48 | public @Nullable String getToggleTargetName(String targetID) { 49 | if (TOGGLE_BREAKPOINT_TARGET_ID.equals(targetID)) { 50 | return "LSP4E Breakpoint"; 51 | } 52 | return null; 53 | } 54 | 55 | @Override 56 | public @Nullable String getToggleTargetDescription(String targetID) { 57 | if (TOGGLE_BREAKPOINT_TARGET_ID.equals(targetID)) { 58 | return "LSP4E Breakpoint for Debug Adapter"; 59 | } 60 | return null; 61 | 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/breakpoints/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.debug.breakpoints; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/console/DSPStreamMonitor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2017 Kichwa Coders Ltd. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.debug.console; 10 | 11 | import org.eclipse.core.runtime.ListenerList; 12 | import org.eclipse.core.runtime.SafeRunner; 13 | import org.eclipse.debug.core.IStreamListener; 14 | import org.eclipse.debug.core.model.IFlushableStreamMonitor; 15 | import org.eclipse.jdt.annotation.Nullable; 16 | 17 | public class DSPStreamMonitor implements IFlushableStreamMonitor { 18 | 19 | private final ListenerList listeners = new ListenerList<>(); 20 | private final StringBuilder stream = new StringBuilder(); 21 | private boolean buffer = true; // buffer by default as first output can happen before listeners are in place 22 | 23 | @Override 24 | public String getContents() { 25 | return stream.toString(); 26 | } 27 | 28 | @Override 29 | public void addListener(IStreamListener listener) { 30 | listeners.add(listener); 31 | } 32 | 33 | @Override 34 | public void removeListener(IStreamListener listener) { 35 | listeners.remove(listener); 36 | } 37 | 38 | public void append(@Nullable String text) { 39 | if (buffer && text != null) { 40 | stream.append(text); 41 | } 42 | notifyAppend(text); 43 | } 44 | 45 | public void notifyAppend(@Nullable String text) { 46 | if (text == null) { 47 | return; 48 | } 49 | for (IStreamListener listener : listeners) { 50 | SafeRunner.run(() -> listener.streamAppended(text, this)); 51 | } 52 | } 53 | 54 | @Override 55 | public void flushContents() { 56 | stream.setLength(0); 57 | stream.trimToSize(); 58 | } 59 | 60 | @Override 61 | public void setBuffered(boolean buffer) { 62 | this.buffer = buffer; 63 | } 64 | 65 | @Override 66 | public boolean isBuffered() { 67 | return buffer; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/console/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.debug.console; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/debugmodel/TraceInputStream.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2017 Kichwa Coders Ltd. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.debug.debugmodel; 10 | 11 | import java.io.FilterInputStream; 12 | import java.io.IOException; 13 | import java.io.InputStream; 14 | import java.io.OutputStream; 15 | 16 | public class TraceInputStream extends FilterInputStream { 17 | private final OutputStream trace; 18 | 19 | public TraceInputStream(InputStream in, OutputStream trace) { 20 | super(in); 21 | this.trace = trace; 22 | } 23 | 24 | @Override 25 | public int read() throws IOException { 26 | int b = in.read(); 27 | trace.write(b); 28 | trace.flush(); 29 | return b; 30 | } 31 | 32 | @Override 33 | public int read(byte[] b, int off, int len) throws IOException { 34 | int n = in.read(b, off, len); 35 | trace.write(b, off, n); 36 | trace.flush(); 37 | return n; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/debugmodel/TraceOutputStream.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2017 Kichwa Coders Ltd. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.debug.debugmodel; 10 | 11 | import java.io.FilterOutputStream; 12 | import java.io.IOException; 13 | import java.io.OutputStream; 14 | 15 | public class TraceOutputStream extends FilterOutputStream { 16 | 17 | private final OutputStream trace; 18 | 19 | public TraceOutputStream(OutputStream out, OutputStream trace) { 20 | super(out); 21 | this.trace = trace; 22 | } 23 | 24 | @Override 25 | public void write(int b) throws IOException { 26 | trace.write(b); 27 | trace.flush(); 28 | out.write(b); 29 | } 30 | 31 | @Override 32 | public void write(byte[] b, int off, int len) throws IOException { 33 | trace.write(b, off, len); 34 | trace.flush(); 35 | out.write(b, off, len); 36 | } 37 | } -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/debugmodel/TransportStreams.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.debug.debugmodel; 10 | 11 | import static org.eclipse.lsp4e.internal.NullSafetyHelper.lateNonNull; 12 | 13 | import java.io.IOException; 14 | import java.io.InputStream; 15 | import java.io.OutputStream; 16 | import java.net.Socket; 17 | 18 | public abstract class TransportStreams { 19 | 20 | public InputStream in = lateNonNull(); 21 | public OutputStream out = lateNonNull(); 22 | 23 | public void close() { 24 | try { 25 | in.close(); 26 | } catch (IOException e1) { 27 | // ignore inner resource exception 28 | } 29 | try { 30 | out.close(); 31 | } catch (IOException e1) { 32 | // ignore inner resource exception 33 | } 34 | } 35 | 36 | public TransportStreams withTrace() { 37 | return new DefaultTransportStreams(new TraceInputStream(in, System.out), 38 | new TraceOutputStream(out, System.out)) { 39 | @Override 40 | public void close() { 41 | TransportStreams.this.close(); 42 | } 43 | }; 44 | } 45 | 46 | public static class DefaultTransportStreams extends TransportStreams { 47 | public DefaultTransportStreams(InputStream in, OutputStream out) { 48 | this.in = in; 49 | this.out = out; 50 | } 51 | } 52 | 53 | public static class SocketTransportStreams extends TransportStreams { 54 | private final Socket socket; 55 | 56 | public SocketTransportStreams(String host, int port) { 57 | try { 58 | this.socket = new Socket(host, port); 59 | in = socket.getInputStream(); 60 | out = socket.getOutputStream(); 61 | } catch (Exception ex) { 62 | throw new RuntimeException(ex); 63 | } 64 | } 65 | 66 | @Override 67 | public void close() { 68 | super.close(); 69 | try { 70 | socket.close(); 71 | } catch (IOException e) { 72 | throw new RuntimeException(e); 73 | } 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/debugmodel/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.debug.debugmodel; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/launcher/DSPOverrideSettingsTab.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Kichwa Coders Ltd. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.debug.launcher; 10 | 11 | import org.eclipse.jdt.annotation.Nullable; 12 | 13 | public class DSPOverrideSettingsTab extends DSPMainTab { 14 | 15 | public DSPOverrideSettingsTab() { 16 | super(true); 17 | } 18 | 19 | @Override 20 | public @Nullable String getId() { 21 | return "org.eclipse.lsp4e.debug.launcher.DSPOverrideSettingsTab"; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/launcher/DSPTabGroup.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2017 Kichwa Coders Ltd. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.debug.launcher; 10 | 11 | import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; 12 | import org.eclipse.debug.ui.CommonTab; 13 | import org.eclipse.debug.ui.ILaunchConfigurationDialog; 14 | 15 | public class DSPTabGroup extends AbstractLaunchConfigurationTabGroup { 16 | 17 | @Override 18 | public void createTabs(ILaunchConfigurationDialog dialog, String mode) { 19 | setTabs(new DSPMainTab(), new CommonTab()); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/launcher/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.debug.launcher; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.debug; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/presentation/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.debug.presentation; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/sourcelookup/AbsolutePathSourceContainer.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2017 Kichwa Coders Ltd. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.debug.sourcelookup; 10 | 11 | import static org.eclipse.lsp4e.internal.ArrayUtil.NO_OBJECTS; 12 | 13 | import java.nio.file.Paths; 14 | 15 | import org.eclipse.core.runtime.CoreException; 16 | import org.eclipse.debug.core.sourcelookup.ISourceContainer; 17 | import org.eclipse.debug.core.sourcelookup.ISourceContainerType; 18 | import org.eclipse.debug.core.sourcelookup.containers.AbstractSourceContainer; 19 | import org.eclipse.jdt.annotation.Nullable; 20 | 21 | public class AbsolutePathSourceContainer extends AbstractSourceContainer implements ISourceContainer { 22 | 23 | @Override 24 | public Object[] findSourceElements(String name) throws CoreException { 25 | if (name != null && Paths.get(name).isAbsolute()) { 26 | return new Object[] { name }; 27 | } 28 | return NO_OBJECTS; 29 | } 30 | 31 | @Override 32 | public String getName() { 33 | return "Absolute Path"; 34 | } 35 | 36 | @Override 37 | public @Nullable ISourceContainerType getType() { 38 | return null; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/sourcelookup/DSPSourceLookupDirector.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2017 Kichwa Coders Ltd. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.debug.sourcelookup; 10 | 11 | import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector; 12 | import org.eclipse.debug.core.sourcelookup.ISourceLookupParticipant; 13 | 14 | public class DSPSourceLookupDirector extends AbstractSourceLookupDirector { 15 | 16 | public static final String ID = "org.eclipse.lsp4e.debug.sourceLocator"; 17 | 18 | @Override 19 | public void initializeParticipants() { 20 | addParticipants(new ISourceLookupParticipant[] { new DSPSourceLookupParticipant() }); 21 | 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/sourcelookup/DSPSourceLookupParticipant.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2017 Kichwa Coders Ltd. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.debug.sourcelookup; 10 | 11 | import org.eclipse.core.runtime.CoreException; 12 | import org.eclipse.debug.core.sourcelookup.AbstractSourceLookupParticipant; 13 | import org.eclipse.jdt.annotation.Nullable; 14 | import org.eclipse.lsp4e.debug.debugmodel.DSPStackFrame; 15 | 16 | public class DSPSourceLookupParticipant extends AbstractSourceLookupParticipant { 17 | 18 | @Override 19 | public @Nullable String getSourceName(Object object) throws CoreException { 20 | if (object instanceof String string) { 21 | return string; 22 | } 23 | if (object instanceof DSPStackFrame stackFrame) { 24 | return stackFrame.getSourceName(); 25 | } 26 | return null; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/sourcelookup/DSPSourcePathComputerDelegate.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2017 Kichwa Coders Ltd. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.debug.sourcelookup; 10 | 11 | import org.eclipse.core.runtime.CoreException; 12 | import org.eclipse.core.runtime.IProgressMonitor; 13 | import org.eclipse.debug.core.ILaunchConfiguration; 14 | import org.eclipse.debug.core.sourcelookup.ISourceContainer; 15 | import org.eclipse.debug.core.sourcelookup.ISourcePathComputerDelegate; 16 | import org.eclipse.jdt.annotation.Nullable; 17 | 18 | public class DSPSourcePathComputerDelegate implements ISourcePathComputerDelegate { 19 | 20 | @Override 21 | public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, 22 | @Nullable IProgressMonitor monitor) throws CoreException { 23 | return new ISourceContainer[] { new AbsolutePathSourceContainer() }; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.debug/src/org/eclipse/lsp4e/debug/sourcelookup/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.debug.sourcelookup; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.jdt/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.jdt/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.eclipse.lsp4e.jdt 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.jdt/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: JDT Integration for LSP4E 4 | Bundle-SymbolicName: org.eclipse.lsp4e.jdt;singleton:=true 5 | Bundle-Version: 0.13.7.qualifier 6 | Export-Package: org.eclipse.lsp4e.jdt 7 | Automatic-Module-Name: org.eclipse.lsp4e.jdt 8 | Bundle-Activator: org.eclipse.lsp4e.jdt.LanguageServerJdtPlugin 9 | Bundle-ActivationPolicy: lazy 10 | Bundle-RequiredExecutionEnvironment: JavaSE-17 11 | Bundle-ClassPath: . 12 | Bundle-Localization: plugin 13 | Bundle-Vendor: Eclipse LSP4E 14 | Require-Bundle: org.eclipse.core.runtime;bundle-version="3.12.0", 15 | org.eclipse.jface.text;bundle-version="3.13.0", 16 | org.eclipse.ui;bundle-version="3.108.0", 17 | org.eclipse.lsp4e;bundle-version="0.18.20", 18 | org.eclipse.jdt.core;bundle-version="3.20.0", 19 | org.eclipse.jdt.ui;bundle-version="3.34.0", 20 | org.eclipse.swt, 21 | org.eclipse.core.resources, 22 | org.eclipse.lsp4j, 23 | org.eclipse.lsp4j.jsonrpc, 24 | org.eclipse.core.resources, 25 | org.eclipse.jdt.annotation, 26 | org.eclipse.ui.editors 27 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.jdt/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | plugin.xml,\ 6 | EPL-2.0.html,\ 7 | plugin.properties 8 | 9 | # JDT Null Analysis for Eclipse 10 | additional.bundles = org.eclipse.jdt.annotation,\ 11 | com.vegardit.no-npe.eea-all 12 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.jdt/plugin.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2020 Pivotal Inc. and others. 3 | # This program and the accompanying materials are made 4 | # available under the terms of the Eclipse Public License 2.0 5 | # which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | # 7 | # SPDX-License-Identifier: EPL-2.0 8 | # 9 | # Contributors: 10 | # - Martin Lippert (Pivotal Inc.) - Initial implementation 11 | ############################################################################### 12 | 13 | lsCompletionComputer_name=Language Server Proposals 14 | languageservers.jdt.preferences.page=Java 15 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.jdt/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 15 | 16 | 17 | 18 | 21 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 35 | 37 | 41 | 42 | 43 | 45 | 47 | 48 | 49 | 51 | 53 | 54 | 55 | 57 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.jdt/src/org/eclipse/lsp4e/jdt/JavaSemanticTokensProcessor.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Broadcom, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * https://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Broadcom, Inc. - initial API and implementation 10 | *******************************************************************************/ 11 | package org.eclipse.lsp4e.jdt; 12 | 13 | import java.util.List; 14 | import java.util.function.Function; 15 | 16 | import org.eclipse.jdt.annotation.Nullable; 17 | import org.eclipse.jdt.ui.text.java.ISemanticTokensProvider; 18 | import org.eclipse.lsp4e.operations.semanticTokens.AbstractcSemanticTokensDataStreamProcessor; 19 | import org.eclipse.lsp4j.Position; 20 | 21 | class JavaSemanticTokensProcessor extends AbstractcSemanticTokensDataStreamProcessor { 22 | 23 | public JavaSemanticTokensProcessor(final Function tokenTypeMapper, 24 | final Function offsetMapper) { 25 | super(offsetMapper, tokenTypeMapper); 26 | } 27 | 28 | @Override 29 | protected ISemanticTokensProvider.@Nullable SemanticToken createTokenData( 30 | ISemanticTokensProvider.@Nullable TokenType tt, int offset, int length, List tokenModifiers) { 31 | if (tt != null) { 32 | return new ISemanticTokensProvider.SemanticToken(offset, length, tt); 33 | } 34 | return null; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.jdt/src/org/eclipse/lsp4e/jdt/LSJavaCompletionWrappingCompletionProposal.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2025 Broadcom Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * - Alex Boyko (Broadcom Inc.) - Initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.jdt; 13 | 14 | import org.eclipse.jdt.annotation.Nullable; 15 | import org.eclipse.jdt.ui.text.java.IJavaCompletionProposal; 16 | import org.eclipse.jface.text.IDocument; 17 | import org.eclipse.jface.text.contentassist.ICompletionProposal; 18 | import org.eclipse.jface.text.contentassist.IContextInformation; 19 | import org.eclipse.swt.graphics.Image; 20 | import org.eclipse.swt.graphics.Point; 21 | 22 | class LSJavaCompletionWrappingCompletionProposal implements IJavaCompletionProposal { 23 | 24 | private final ICompletionProposal delegate; 25 | 26 | public LSJavaCompletionWrappingCompletionProposal(ICompletionProposal delegate) { 27 | this.delegate = delegate; 28 | } 29 | 30 | @Override 31 | public void apply(IDocument document) { 32 | delegate.apply(document); 33 | } 34 | 35 | @Override 36 | public @Nullable Point getSelection(IDocument document) { 37 | return delegate.getSelection(document); 38 | } 39 | 40 | @Override 41 | public @Nullable String getAdditionalProposalInfo() { 42 | return delegate.getAdditionalProposalInfo(); 43 | } 44 | 45 | @Override 46 | public String getDisplayString() { 47 | return delegate.getDisplayString(); 48 | } 49 | 50 | @Override 51 | public @Nullable Image getImage() { 52 | return delegate.getImage(); 53 | } 54 | 55 | @Override 56 | public @Nullable IContextInformation getContextInformation() { 57 | return delegate.getContextInformation(); 58 | } 59 | 60 | @Override 61 | public int getRelevance() { 62 | return -1; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.jdt/src/org/eclipse/lsp4e/jdt/Messages.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2020 Pivotal Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Martin Lippert (Pivotal Inc.) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.jdt; 13 | 14 | import org.eclipse.jdt.annotation.NonNullByDefault; 15 | import org.eclipse.osgi.util.NLS; 16 | 17 | @NonNullByDefault({}) 18 | public class Messages extends NLS { 19 | 20 | public static String javaSpecificCompletionError; 21 | 22 | static { 23 | NLS.initializeMessages("org.eclipse.lsp4e.jdt.messages", Messages.class); //$NON-NLS-1$ 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.jdt/src/org/eclipse/lsp4e/jdt/messages.properties: -------------------------------------------------------------------------------- 1 | # ******************************************************************************* 2 | # Copyright (c) 2020 Pivotal Inc. and others. 3 | # This program and the accompanying materials are made 4 | # available under the terms of the Eclipse Public License 2.0 5 | # which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | # 7 | # SPDX-License-Identifier: EPL-2.0 8 | # 9 | # Contributors: 10 | # Martin Lippert (Pivotal Inc.) - initial implementation 11 | # *******************************************************************************/ 12 | javaSpecificCompletionError=Error while computing language-server-based completion contribution 13 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.jdt/src/org/eclipse/lsp4e/jdt/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.jdt; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.jdt/src/org/eclipse/lsp4e/jdt/preferences/LspJdtPreferencesPage.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2025 Broadcom, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * https://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Broadcom, Inc. - initial API and implementation 10 | *******************************************************************************/ 11 | package org.eclipse.lsp4e.jdt.preferences; 12 | 13 | import org.eclipse.jface.preference.BooleanFieldEditor; 14 | import org.eclipse.jface.preference.FieldEditorPreferencePage; 15 | import org.eclipse.lsp4e.internal.NullSafetyHelper; 16 | import org.eclipse.lsp4e.jdt.LanguageServerJdtPlugin; 17 | import org.eclipse.swt.widgets.Composite; 18 | import org.eclipse.ui.IWorkbench; 19 | import org.eclipse.ui.IWorkbenchPreferencePage; 20 | 21 | public final class LspJdtPreferencesPage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { 22 | 23 | @Override 24 | public void init(IWorkbench workbench) { 25 | setPreferenceStore(NullSafetyHelper.castNonNull(LanguageServerJdtPlugin.getDefault()).getPreferenceStore()); 26 | } 27 | 28 | @Override 29 | protected void createFieldEditors() { 30 | Composite fieldEditorParent = getFieldEditorParent(); 31 | 32 | addField(new BooleanFieldEditor(PreferenceConstants.PREF_SEMANTIC_TOKENS_SWITCH, "Embedded languages syntax highlighting in Java Editor", fieldEditorParent)); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.jdt/src/org/eclipse/lsp4e/jdt/preferences/LspJdtPrefsInitializer.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Broadcom, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * https://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Broadcom, Inc. - initial API and implementation 10 | *******************************************************************************/ 11 | package org.eclipse.lsp4e.jdt.preferences; 12 | 13 | import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer; 14 | import org.eclipse.jface.preference.IPreferenceStore; 15 | import org.eclipse.lsp4e.jdt.LanguageServerJdtPlugin; 16 | 17 | public final class LspJdtPrefsInitializer extends AbstractPreferenceInitializer { 18 | 19 | public LspJdtPrefsInitializer() { 20 | } 21 | 22 | @Override 23 | public void initializeDefaultPreferences() { 24 | LanguageServerJdtPlugin plugin = LanguageServerJdtPlugin.getDefault(); 25 | if (plugin == null) { 26 | throw new IllegalStateException("Plugin hasn't been started!"); 27 | } 28 | IPreferenceStore store = plugin.getPreferenceStore(); 29 | 30 | store.setDefault(PreferenceConstants.PREF_SEMANTIC_TOKENS_SWITCH, false); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.jdt/src/org/eclipse/lsp4e/jdt/preferences/PreferenceConstants.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Broadcom, Inc. 3 | * All rights reserved. This program and the accompanying materials 4 | * are made available under the terms of the Eclipse Public License v1.0 5 | * which accompanies this distribution, and is available at 6 | * https://www.eclipse.org/legal/epl-v10.html 7 | * 8 | * Contributors: 9 | * Broadcom, Inc. - initial API and implementation 10 | *******************************************************************************/ 11 | package org.eclipse.lsp4e.jdt.preferences; 12 | 13 | public final class PreferenceConstants { 14 | 15 | public static final String PREF_SEMANTIC_TOKENS_SWITCH = "semanticHighlightReconciler.java.enabled"; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.eclipse.lsp4e.test 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Tests for language server bundle (Incubation) 4 | Bundle-SymbolicName: org.eclipse.lsp4e.test;singleton:=true 5 | Bundle-Version: 0.15.26.qualifier 6 | Fragment-Host: org.eclipse.lsp4e 7 | Bundle-Vendor: Eclipse LSP4E 8 | Bundle-RequiredExecutionEnvironment: JavaSE-17 9 | Require-Bundle: org.eclipse.core.runtime, 10 | org.eclipse.core.resources, 11 | org.junit, 12 | org.eclipse.ui, 13 | org.eclipse.ui.workbench, 14 | org.eclipse.ui.ide, 15 | org.eclipse.ui.workbench.texteditor, 16 | org.eclipse.ui.genericeditor, 17 | org.eclipse.jface.text, 18 | org.eclipse.ui.tests.harness, 19 | org.eclipse.search, 20 | org.eclipse.core.expressions, 21 | org.eclipse.lsp4e.tests.mock, 22 | org.eclipse.lsp4e.debug, 23 | org.eclipse.lsp4j, 24 | org.eclipse.jdt.annotation, 25 | org.eclipse.ui.tests.harness, 26 | org.eclipse.ui.monitoring, 27 | org.eclipse.core.variables, 28 | org.eclipse.e4.ui.model.workbench, 29 | org.eclipse.e4.ui.workbench, 30 | org.eclipse.tm4e.ui 31 | Automatic-Module-Name: org.eclipse.lsp4e.test 32 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | EPL-2.0.html,\ 5 | .,\ 6 | fragment.xml 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | 5 | org.eclipse.lsp4e 6 | parent 7 | 0.13.1-SNAPSHOT 8 | 9 | org.eclipse.lsp4e.test 10 | eclipse-test-plugin 11 | 0.15.26-SNAPSHOT 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.tycho 21 | target-platform-configuration 22 | ${tycho-version} 23 | 24 | 25 | 26 | 27 | eclipse-feature 28 | org.eclipse.rcp 29 | 0.0.0 30 | 31 | 32 | 33 | 34 | 35 | 36 | org.eclipse.tycho 37 | tycho-surefire-plugin 38 | ${tycho-version} 39 | 40 | 41 | false 42 | true 43 | true 44 | 1200 45 | -Dfile.encoding=${project.build.sourceEncoding} -Xms1g -Xmx1g -Djava.util.logging.config.file=${project.basedir}/src/jul.properties ${ui.test.vmargs} ${os-jvm-flags} 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | macosx-jvm-flags 54 | 55 | 56 | mac 57 | 58 | 59 | 60 | -XstartOnFirstThread 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/src/jul.properties: -------------------------------------------------------------------------------- 1 | # configure log output target(s) 2 | handlers=java.util.logging.ConsoleHandler 3 | java.util.logging.ConsoleHandler.level=INFO 4 | java.util.logging.ConsoleHandler.formatter=java.util.logging.SimpleFormatter 5 | 6 | # configure log format 7 | # %1=date %2=source %3=logger %4=level %5=message, %6=thrown 8 | java.util.logging.SimpleFormatter.format=%1$tT %4$s [%3$s] %5$s %6$s%n 9 | 10 | 11 | # configure log levels 12 | .level=INFO 13 | 14 | # this suppresses the useless logging of "IOException: Connection reset by peer" at INFO level which occurs when the LS was gracefully stopped 15 | org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.level=WARNING 16 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/debug/DebugTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Victor Rubezhny (Red Hat Inc.) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.test.debug; 13 | 14 | import static org.junit.Assert.assertFalse; 15 | import static org.junit.Assert.assertNotNull; 16 | import static org.junit.Assert.fail; 17 | 18 | import java.util.Map; 19 | 20 | import org.eclipse.lsp4e.debug.debugmodel.DSPDebugTarget; 21 | import org.eclipse.lsp4e.test.utils.AbstractTestWithProject; 22 | import org.eclipse.lsp4j.jsonrpc.json.JsonRpcMethod; 23 | import org.eclipse.lsp4j.jsonrpc.services.ServiceEndpoints; 24 | import org.junit.Test; 25 | 26 | public class DebugTest extends AbstractTestWithProject { 27 | 28 | /** 29 | * Test for the `IllegalStateException: Duplicate RPC method runInTerminal` issue. 30 | * 31 | * The issue has started to appear after the move of `runInTerminal` method from the `IDebugProtocolServer` 32 | * interface to `IDebugProtocolClient` interface in LSP5J while the DSPDebugTarget class that implements `runInTerminal` 33 | * method of `IDebugProtocolClient` interface leaved unchanged thus creating an RPC method duplication. 34 | * 35 | * @throws Exception 36 | */ 37 | @Test 38 | public void testSupportedJSONRPCMethods() throws Exception { 39 | try { 40 | Map rpcMethods = ServiceEndpoints.getSupportedMethods(DSPDebugTarget.class); 41 | assertNotNull("RPC Methods not found on DSPDebugTarget", rpcMethods); 42 | assertFalse("Zero RPC Methods found on DSPDebugTarget", rpcMethods.isEmpty()); 43 | } catch (Throwable ex) { 44 | fail("An error occured while getting the RPC Methods of DSPDebugTarget: " + ex.getMessage()); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/edit/DocumentRevertAndCloseTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2017 Pivotal Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Alex Boyko (Pivotal Inc.) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.test.edit; 13 | 14 | import static org.eclipse.lsp4e.test.utils.TestUtils.waitForAndAssertCondition; 15 | import static org.junit.Assert.assertNotNull; 16 | 17 | import org.eclipse.core.resources.IFile; 18 | import org.eclipse.jface.text.IDocument; 19 | import org.eclipse.jface.text.ITextViewer; 20 | import org.eclipse.lsp4e.LSPEclipseUtils; 21 | import org.eclipse.lsp4e.LanguageServers; 22 | import org.eclipse.lsp4e.test.utils.AbstractTestWithProject; 23 | import org.eclipse.lsp4e.test.utils.TestUtils; 24 | import org.eclipse.lsp4e.tests.mock.MockLanguageServer; 25 | import org.eclipse.ui.IEditorPart; 26 | import org.eclipse.ui.texteditor.AbstractTextEditor; 27 | import org.junit.Test; 28 | 29 | public class DocumentRevertAndCloseTest extends AbstractTestWithProject { 30 | 31 | @Test 32 | public void testShutdownLsp() throws Exception { 33 | IFile testFile = TestUtils.createUniqueTestFile(project, "Hello!"); 34 | IEditorPart editor = TestUtils.openEditor(testFile); 35 | ITextViewer viewer = LSPEclipseUtils.getTextViewer(editor); 36 | 37 | // make sure that timestamp after save will differ from creation time (no better idea at the moment) 38 | testFile.setLocalTimeStamp(0); 39 | 40 | // Force LS to initialize and open file 41 | IDocument document = LSPEclipseUtils.getDocument(testFile); 42 | assertNotNull(document); 43 | LanguageServers.forDocument(document).anyMatching(); 44 | 45 | viewer.getDocument().replace(0, 0, "Bye!"); 46 | ((AbstractTextEditor)editor).doRevertToSaved(); 47 | ((AbstractTextEditor)editor).getSite().getPage().closeEditor(editor, false); 48 | 49 | waitForAndAssertCondition(3_000, () -> !MockLanguageServer.INSTANCE.isRunning()); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/message/ShowMessageTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2021 Red Hat, Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.test.message; 10 | 11 | import static org.eclipse.lsp4e.test.utils.TestUtils.waitForAndAssertCondition; 12 | 13 | import java.util.List; 14 | import java.util.Set; 15 | import java.util.stream.Collectors; 16 | import java.util.stream.Stream; 17 | 18 | import org.eclipse.core.resources.IFile; 19 | import org.eclipse.core.runtime.CoreException; 20 | import org.eclipse.lsp4e.test.utils.AbstractTestWithProject; 21 | import org.eclipse.lsp4e.test.utils.TestUtils; 22 | import org.eclipse.lsp4e.tests.mock.MockLanguageServer; 23 | import org.eclipse.lsp4e.ui.UI; 24 | import org.eclipse.lsp4j.MessageParams; 25 | import org.eclipse.lsp4j.MessageType; 26 | import org.eclipse.lsp4j.services.LanguageClient; 27 | import org.eclipse.swt.widgets.Display; 28 | import org.eclipse.swt.widgets.Shell; 29 | import org.eclipse.ui.ide.IDE; 30 | import org.junit.Test; 31 | 32 | public class ShowMessageTest extends AbstractTestWithProject { 33 | 34 | @Test 35 | public void testShowMessage() throws CoreException { 36 | IFile file = TestUtils.createUniqueTestFile(project, ""); 37 | IDE.openEditor(UI.getActivePage(), file); 38 | final var messageContent = "test notification " + System.currentTimeMillis(); 39 | final var message = new MessageParams(MessageType.Error, messageContent); 40 | Display display = Display.getDefault(); 41 | Set currentShells = Stream.of(display.getShells()).filter(Shell::isVisible).collect(Collectors.toSet()); 42 | List remoteProxies = MockLanguageServer.INSTANCE.getRemoteProxies(); 43 | remoteProxies.forEach(client -> client.showMessage(message)); 44 | waitForAndAssertCondition(3_000, 45 | () -> Stream.of(display.getShells()).filter(Shell::isVisible).count() > currentShells.size()); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/semanticTokens/SemanticTokensDataStreamProcessorTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Avaloq Group AG. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.test.semanticTokens; 10 | 11 | import static org.junit.Assert.assertEquals; 12 | 13 | import java.util.List; 14 | 15 | import org.eclipse.jface.text.Document; 16 | import org.eclipse.lsp4e.operations.semanticTokens.SemanticTokensDataStreamProcessor; 17 | import org.eclipse.lsp4e.test.utils.AbstractTest; 18 | import org.eclipse.lsp4j.SemanticTokensLegend; 19 | import org.eclipse.swt.custom.StyleRange; 20 | import org.junit.Test; 21 | 22 | public class SemanticTokensDataStreamProcessorTest extends AbstractTest { 23 | 24 | @Test 25 | public void testKeyword() { 26 | final var document = new Document(SemanticTokensTestUtil.keywordText); 27 | 28 | final var processor = new SemanticTokensDataStreamProcessor(SemanticTokensTestUtil 29 | .keywordTokenTypeMapper(SemanticTokensTestUtil.RED_TOKEN), SemanticTokensTestUtil.offsetMapper(document)); 30 | 31 | List expectedStream = SemanticTokensTestUtil.keywordSemanticTokens(); 32 | List expectedStyleRanges = List.of(// 33 | new StyleRange(0, 4, SemanticTokensTestUtil.RED, null), // 34 | new StyleRange(15, 4, SemanticTokensTestUtil.RED, null), // 35 | new StyleRange(24, 7, SemanticTokensTestUtil.RED, null)// 36 | ); 37 | 38 | List styleRanges = processor.getTokensData(expectedStream, getSemanticTokensLegend()); 39 | 40 | assertEquals(expectedStyleRanges, styleRanges); 41 | } 42 | 43 | private SemanticTokensLegend getSemanticTokensLegend() { 44 | final var semanticTokensLegend = new SemanticTokensLegend(); 45 | semanticTokensLegend.setTokenTypes(List.of("keyword","other")); 46 | semanticTokensLegend.setTokenModifiers(List.of("obsolete")); 47 | return semanticTokensLegend; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/semanticTokens/SemanticTokensLegendProviderTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Avaloq Group AG. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.test.semanticTokens; 10 | 11 | import static org.junit.Assert.assertEquals; 12 | import static org.junit.Assert.assertNotNull; 13 | 14 | import java.util.List; 15 | 16 | import org.eclipse.core.resources.IFile; 17 | import org.eclipse.core.runtime.CoreException; 18 | import org.eclipse.lsp4e.LanguageServerWrapper; 19 | import org.eclipse.lsp4e.LanguageServiceAccessor; 20 | import org.eclipse.lsp4e.operations.semanticTokens.SemanticTokensClient; 21 | import org.eclipse.lsp4e.test.utils.AbstractTestWithProject; 22 | import org.eclipse.lsp4e.test.utils.TestUtils; 23 | import org.junit.Test; 24 | 25 | public class SemanticTokensLegendProviderTest extends AbstractTestWithProject { 26 | 27 | @Test 28 | public void testSemanticTokensLegendProvider() throws CoreException { 29 | // Setup Server Capabilities 30 | List tokenTypes = List.of("keyword","other"); 31 | List tokenModifiers = List.of("obsolete"); 32 | SemanticTokensTestUtil.setSemanticTokensLegend(tokenTypes, tokenModifiers); 33 | 34 | // Setup test data 35 | IFile file = TestUtils.createUniqueTestFile(project, "lspt", "test content"); 36 | // start the LS 37 | LanguageServerWrapper wrapper = LanguageServiceAccessor.getLSWrappers(file, c -> Boolean.TRUE).iterator() 38 | .next(); 39 | 40 | final var semanticTokensLegend = SemanticTokensClient.DEFAULT.getSemanticTokensLegend(wrapper); 41 | assertNotNull(semanticTokensLegend); 42 | assertEquals(tokenTypes, semanticTokensLegend.getTokenTypes()); 43 | assertEquals(tokenModifiers, semanticTokensLegend.getTokenModifiers()); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/utils/AbstractTest.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Vegard IT GmbH and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Sebastian Thomschke (Vegard IT GmbH) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.test.utils; 13 | 14 | import java.io.PrintStream; 15 | 16 | import org.eclipse.lsp4e.tests.mock.MockLanguageServer; 17 | import org.eclipse.lsp4j.ServerCapabilities; 18 | import org.junit.AfterClass; 19 | import org.junit.BeforeClass; 20 | import org.junit.Rule; 21 | 22 | /** 23 | * Test base class that configures a {@link AllCleanRule} and a 24 | * {@link TestInfoRule} and works around a surefire-plugin issue which 25 | * suppresses output to stderr 26 | */ 27 | public abstract class AbstractTest { 28 | 29 | private static PrintStream originalSystemErr; 30 | 31 | private static final boolean isExecutedBySurefirePlugin = System.getProperty("surefire.real.class.path") != null; 32 | 33 | @BeforeClass 34 | public static void setUpSystemErrRedirection() throws Exception { 35 | if (isExecutedBySurefirePlugin) { 36 | // redirect stderr to stdout during test execution as it is otherwise suppressed 37 | // by the surefire-plugin 38 | originalSystemErr = System.err; 39 | System.setErr(System.out); 40 | } 41 | } 42 | 43 | @AfterClass 44 | public static void tearDownSystemErrRedirection() throws Exception { 45 | if (isExecutedBySurefirePlugin) { 46 | System.setErr(originalSystemErr); 47 | } 48 | } 49 | 50 | public final @Rule(order = 1) AllCleanRule allCleanRule = new AllCleanRule(this::getServerCapabilities); 51 | public final @Rule(order = 0) TestInfoRule testInfo = new TestInfoRule(); 52 | 53 | /** 54 | * Override if required, used by {@link #allCleanRule} 55 | */ 56 | protected ServerCapabilities getServerCapabilities() { 57 | return MockLanguageServer.defaultServerCapabilities(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/utils/AbstractTestWithProject.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Vegard IT GmbH and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Sebastian Thomschke (Vegard IT GmbH) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.test.utils; 13 | 14 | import org.eclipse.core.resources.IProject; 15 | import org.eclipse.core.resources.IResource; 16 | import org.junit.After; 17 | import org.junit.Before; 18 | 19 | /** 20 | * Test base class that provides a new unique temporary test project for each @org.junit.Test run 21 | */ 22 | public abstract class AbstractTestWithProject extends AbstractTest { 23 | protected IProject project; 24 | 25 | @Before 26 | public void setUpProject() throws Exception { 27 | project = TestUtils.createProject( 28 | testInfo.getSimpleClassName() + "_" + testInfo.getMethodName() + "_" + System.currentTimeMillis()); 29 | } 30 | 31 | @After 32 | public void tearDownProject() throws Exception { 33 | if (project != null) { 34 | project.delete(IResource.FORCE, null); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/utils/BlockingWorkspaceJob.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Erik Brangs and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Erik Brangs - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.test.utils; 13 | 14 | import java.util.concurrent.CountDownLatch; 15 | 16 | import org.eclipse.core.resources.WorkspaceJob; 17 | import org.eclipse.core.runtime.CoreException; 18 | import org.eclipse.core.runtime.IProgressMonitor; 19 | import org.eclipse.core.runtime.IStatus; 20 | import org.eclipse.core.runtime.Status; 21 | 22 | public class BlockingWorkspaceJob extends WorkspaceJob { 23 | 24 | public BlockingWorkspaceJob(String name) { 25 | super(name); 26 | } 27 | 28 | private CountDownLatch countDownLatch = new CountDownLatch(1); 29 | 30 | @Override 31 | public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { 32 | try { 33 | countDownLatch.await(); 34 | } catch (InterruptedException e) { 35 | return Status.CANCEL_STATUS; 36 | } 37 | return Status.OK_STATUS; 38 | } 39 | 40 | public void progress() { 41 | countDownLatch.countDown(); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/utils/MappingEnablementTester.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2018 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Rastislav Wagner (Red Hat Inc.) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.test.utils; 13 | 14 | import org.eclipse.core.expressions.PropertyTester; 15 | 16 | public class MappingEnablementTester extends PropertyTester { 17 | 18 | public static boolean enabled = false; 19 | 20 | @Override 21 | public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { 22 | return enabled; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/utils/MockConnectionProviderWithException.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2017 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Lucia Jelinkova (Red Hat Inc.) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.test.utils; 13 | 14 | import org.eclipse.lsp4e.tests.mock.MockConnectionProvider; 15 | 16 | public class MockConnectionProviderWithException extends MockConnectionProvider { 17 | 18 | public MockConnectionProviderWithException() { 19 | throw new IllegalStateException("Testing error from constructor"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/utils/NoErrorLoggedRule.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2017 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Mickael Istria (Red Hat Inc.) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.test.utils; 13 | 14 | import java.lang.System.Logger.Level; 15 | import java.util.ArrayList; 16 | import java.util.Collections; 17 | import java.util.List; 18 | 19 | import org.eclipse.core.runtime.ILog; 20 | import org.eclipse.core.runtime.ILogListener; 21 | import org.eclipse.core.runtime.IStatus; 22 | import org.eclipse.lsp4e.LanguageServerPlugin; 23 | import org.junit.Assert; 24 | import org.junit.rules.TestWatcher; 25 | import org.junit.runner.Description; 26 | 27 | public class NoErrorLoggedRule extends TestWatcher { 28 | 29 | private ILog log; 30 | private ILogListener listener; 31 | private final List loggedErrors = new ArrayList<>(); 32 | 33 | public NoErrorLoggedRule() { 34 | this(LanguageServerPlugin.getDefault().getLog()); 35 | } 36 | 37 | public NoErrorLoggedRule(ILog log) { 38 | this.log = log; 39 | final var logger = System.getLogger(log.getBundle().getSymbolicName()); 40 | listener = (status, unused) -> { 41 | switch (status.getSeverity()) { 42 | case IStatus.ERROR: 43 | loggedErrors.add(status); 44 | logger.log(Level.ERROR, status.toString(), status.getException()); 45 | break; 46 | case IStatus.WARNING: 47 | logger.log(Level.WARNING, status.toString(), status.getException()); 48 | break; 49 | case IStatus.INFO: 50 | logger.log(Level.INFO, status.toString(), status.getException()); 51 | break; 52 | } 53 | }; 54 | } 55 | 56 | @Override 57 | protected void starting(Description description) { 58 | super.starting(description); 59 | loggedErrors.clear(); 60 | log.addLogListener(listener); 61 | } 62 | 63 | @Override 64 | protected void finished(Description description) { 65 | log.removeLogListener(listener); 66 | Assert.assertEquals("Some errors were logged", Collections.emptyList(), loggedErrors); 67 | super.finished(description); 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/utils/OtherFileStore.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2021 Avaloq. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Rub�n Porras Campo (Avaloq) - Bug 576425 - Support Remote Files 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.test.utils; 13 | 14 | import java.io.InputStream; 15 | import java.net.URI; 16 | 17 | import org.eclipse.core.filesystem.EFS; 18 | import org.eclipse.core.filesystem.IFileInfo; 19 | import org.eclipse.core.filesystem.IFileStore; 20 | import org.eclipse.core.filesystem.provider.FileInfo; 21 | import org.eclipse.core.filesystem.provider.FileStore; 22 | import org.eclipse.core.runtime.CoreException; 23 | import org.eclipse.core.runtime.IProgressMonitor; 24 | import org.eclipse.core.runtime.Path; 25 | 26 | /** 27 | * A file store to be used together with the {@link OtherFileSystem} 28 | * 29 | */ 30 | public class OtherFileStore extends FileStore { 31 | 32 | private final URI location; 33 | 34 | public OtherFileStore(URI location) { 35 | this.location = location; 36 | } 37 | 38 | @Override 39 | public String[] childNames(int options, IProgressMonitor monitor) throws CoreException { 40 | return FileStore.EMPTY_STRING_ARRAY; 41 | } 42 | 43 | @Override 44 | public IFileInfo fetchInfo(int options, IProgressMonitor monitor) throws CoreException { 45 | final var result = new FileInfo(); 46 | result.setDirectory(false); 47 | result.setExists(true); 48 | result.setLastModified(1);//last modified of zero indicates non-existence 49 | return result; 50 | } 51 | 52 | @Override 53 | public IFileStore getChild(String name) { 54 | return EFS.getNullFileSystem().getStore(new Path(name).makeAbsolute()); 55 | } 56 | 57 | @Override 58 | public void delete(int options, IProgressMonitor monitor) { 59 | //nothing to do - virtual resources don't exist in any physical file system 60 | } 61 | 62 | @Override 63 | public String getName() { 64 | return "other"; 65 | } 66 | 67 | @Override 68 | public IFileStore getParent() { 69 | return null; 70 | } 71 | 72 | @Override 73 | public InputStream openInputStream(int options, IProgressMonitor monitor) throws CoreException { 74 | return null; 75 | } 76 | 77 | @Override 78 | public URI toURI() { 79 | return location; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/utils/OtherFileSystem.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2021 Avaloq. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Rub�n Porras Campo (Avaloq) - Bug 576425 - Support Remote Files 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.test.utils; 13 | 14 | import java.net.URI; 15 | 16 | import org.eclipse.core.filesystem.IFileStore; 17 | import org.eclipse.core.filesystem.provider.FileSystem; 18 | 19 | /** 20 | * A file system to test custom filesystems 21 | * 22 | */ 23 | public class OtherFileSystem extends FileSystem { 24 | 25 | @Override 26 | public IFileStore getStore(URI uri) { 27 | return new OtherFileStore(uri); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.test/src/org/eclipse/lsp4e/test/utils/TestInfoRule.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Vegard IT GmbH and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Sebastian Thomschke (Vegard IT GmbH) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.test.utils; 13 | 14 | import java.lang.System.Logger.Level; 15 | 16 | import org.junit.rules.TestName; 17 | import org.junit.runner.Description; 18 | 19 | public class TestInfoRule extends TestName { 20 | private volatile Class testClass; 21 | private volatile String displayName; 22 | 23 | @Override 24 | protected void starting(Description d) { 25 | super.starting(d); 26 | testClass = d.getTestClass(); 27 | System.getLogger(testClass.getName()).log(Level.INFO, "Testing [" + getMethodName() + "()]..."); 28 | } 29 | 30 | public String getClassName() { 31 | return testClass.getName(); 32 | } 33 | 34 | public String getDisplayName() { 35 | return displayName; 36 | } 37 | 38 | public String getSimpleClassName() { 39 | return testClass.getSimpleName(); 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return getClassName() + "#" + getMethodName(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.tests.mock/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.tests.mock/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.eclipse.lsp4e.tests.mock 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.tests.mock/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Mock Language Server to test LSP4E 4 | Bundle-SymbolicName: org.eclipse.lsp4e.tests.mock 5 | Bundle-Version: 0.16.15.qualifier 6 | Bundle-Vendor: Eclipse LSP4E 7 | Bundle-RequiredExecutionEnvironment: JavaSE-17 8 | Require-Bundle: org.eclipse.lsp4j, 9 | org.eclipse.lsp4j.jsonrpc, 10 | org.eclipse.lsp4e, 11 | org.eclipse.jdt.annotation, 12 | com.google.guava 13 | Export-Package: org.eclipse.lsp4e.tests.mock 14 | Automatic-Module-Name: org.eclipse.lsp4e.tests.mock 15 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e.tests.mock/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | EPL-2.0.html 6 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/.gitignore: -------------------------------------------------------------------------------- 1 | /resources/highlight.min.js/ 2 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/.options: -------------------------------------------------------------------------------- 1 | # Debugging options for the org.eclipse.lsp4e/debug plug-in 2 | 3 | org.eclipse.lsp4e/debug= false -------------------------------------------------------------------------------- /org.eclipse.lsp4e/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.eclipse.lsp4e 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.pde.ds.core.builder 25 | 26 | 27 | 28 | 29 | org.eclipse.m2e.core.maven2Builder 30 | 31 | 32 | 33 | 34 | 35 | org.eclipse.m2e.core.maven2Nature 36 | org.eclipse.pde.PluginNature 37 | org.eclipse.jdt.core.javanature 38 | 39 | 40 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | resolve.requirebundle=false 3 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/OSGI-INF/org.eclipse.lsp4e.format.DefaultFormatRegionsProvider.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | bin.includes = META-INF/,\ 3 | .,\ 4 | plugin.xml,\ 5 | plugin.properties,\ 6 | EPL-2.0.html,\ 7 | icons/,\ 8 | .options,\ 9 | resources/,\ 10 | schema/,\ 11 | OSGI-INF/ 12 | src.includes = schema/ 13 | 14 | # JDT Null Analysis for Eclipse 15 | additional.bundles = org.eclipse.jdt.annotation,\ 16 | com.vegardit.no-npe.eea-all 17 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/dlcl16/alphab_sort_co.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/dlcl16/alphab_sort_co.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/dlcl16/alphab_sort_co@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/dlcl16/alphab_sort_co@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/dlcl16/call_hierarchy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/dlcl16/call_hierarchy.gif -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/dlcl16/fields_co.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/dlcl16/fields_co.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/dlcl16/link_to_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/dlcl16/link_to_editor.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/dlcl16/link_to_editor@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/dlcl16/link_to_editor@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/dlcl16/type_hierarchy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/dlcl16/type_hierarchy.gif -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/elcl16/alphab_sort_co.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/elcl16/alphab_sort_co.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/elcl16/alphab_sort_co@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/elcl16/alphab_sort_co@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/elcl16/fields_co.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/elcl16/fields_co.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/elcl16/link_to_editor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/elcl16/link_to_editor.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/elcl16/link_to_editor@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/elcl16/link_to_editor@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/elcl16/sub_co.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/elcl16/sub_co.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/elcl16/sub_co@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/elcl16/sub_co@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/elcl16/super_co.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/elcl16/super_co.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/elcl16/super_co@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/elcl16/super_co@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/array.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/array.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/array@2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/array@2.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/boolean.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/boolean.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/boolean@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/boolean@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/class.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/class.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/class@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/class@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/constant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/constant.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/constant@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/constant@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/constructor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/constructor.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/constructor@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/constructor@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/enum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/enum.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/enum@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/enum@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/enum_member.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/enum_member.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/enum_member@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/enum_member@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/field.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/field.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/field@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/field@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/function.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/function.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/function@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/function@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/interface.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/interface.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/interface@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/interface@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/keyword.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/keyword.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/keyword@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/keyword@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/method.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/method.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/method@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/method@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/module.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/module.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/module@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/module@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/namespace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/namespace.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/namespace@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/namespace@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/null.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/null.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/null@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/null@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/number.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/number.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/number@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/number@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/object.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/object.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/object@2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/object@2.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/package.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/package.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/package@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/package@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/property.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/property.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/property@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/property@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/reference.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/reference.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/reference@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/reference@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/snippet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/snippet.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/snippet@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/snippet@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/struct.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/struct.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/struct@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/struct@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/terminate_co.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/terminate_co.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/terminate_co@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/terminate_co@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/text.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/text@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/text@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/type_parameter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/type_parameter.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/type_parameter@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/type_parameter@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/unit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/unit.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/unit@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/unit@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/value.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/value.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/value@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/value@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/variable.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/variable.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/icons/full/obj16/variable@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-lsp4e/lsp4e/30a3b9ed53bec1b70cc000438b2d9823e41e2fde/org.eclipse.lsp4e/icons/full/obj16/variable@2x.png -------------------------------------------------------------------------------- /org.eclipse.lsp4e/plugin.properties: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Copyright (c) 2016 Red Hat Inc. and others. 3 | # This program and the accompanying materials are made 4 | # available under the terms of the Eclipse Public License 2.0 5 | # which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | # 7 | # SPDX-License-Identifier: EPL-2.0 8 | # 9 | # Contributors: 10 | # - Mickael Istria (Red Hat Inc.) - Initial implementation 11 | # - Michal Niewrzal (Rogue Wave) 12 | ############################################################################### 13 | 14 | commands.category.name=Language Servers 15 | format.command.name=Format 16 | commands.symbolsInFile.name=Go to Symbol in File 17 | commands.symbolsInWorkspace.name=Go to Symbol in Workspace 18 | openDeclarationHyperlink_name=Go to declaration 19 | openDeclarationHyperlink_description=Get to the location where this element is declared 20 | refactorings.menu.label=Refactorings 21 | codeactions.menu.label=Code Actions 22 | languageservers.preferences.page=Language Servers 23 | languageservers.preferences.folding.page=Folding 24 | languageservers.preferences.logging.page=Logs 25 | notification.category.label = LSP 26 | notification.event.label = LSP Notification 27 | command.toggle.highlight.label = Toggle Mark Occurrences 28 | command.toggle.highlight.name = Toggle Highlight 29 | command.toggle.outline.collapseAll.name = Collapse All 30 | command.toggle.outline.collapseAll.label = Collapse All 31 | command.toggle.outline.sort.name = Sort 32 | command.toggle.outline.sort.label = Sort 33 | command.toggle.outline.hideFields.name = Hide Fields 34 | command.toggle.outline.hideFields.label = Hide Fields 35 | command.open.call.hierarchy.name = Open Call Hierarchy 36 | command.open.call.hierarchy.description = Open Call Hierarchy for the selected item 37 | command.open.type.hierarchy.name = Open Type Hierarchy 38 | command.open.type.hierarchy.description = Open Type Hierarchy for the selected item 39 | command.selection.range.up.name=Enclosing Element 40 | command.selection.range.up.description=Expand Selection To Enclosing Element 41 | command.selection.range.down.name=Restore To Last Selection 42 | command.selection.range.down.description=Expand Selection To Restore To Last Selection 43 | markers.name = Language Servers 44 | command.open.quick.type.hierarchy.name = Quick Type Hierarchy 45 | command.open.quick.type.hierarchy.description = Open Quick Call Hierarchy for the selected item 46 | view.callHierarchy.name = Call Hierarchy 47 | view.typeHierarchy.name = Type Hierarchy 48 | view.languageServers.name = Language Servers 49 | viewsCategory.name = Language Servers -------------------------------------------------------------------------------- /org.eclipse.lsp4e/resources/css/dark.css: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2017 Rogue Wave Software Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Michal Niewrzal (Rogue Wave Software Inc.) - initial implementation 11 | *******************************************************************************/ 12 | 13 | IEclipsePreferences#org-eclipse-ui-editors:org-eclipse-lsp4e { 14 | preferences: 15 | 'LSP4EReadOccurrenceIndicationColor=27,98,145' 16 | 'LSP4EWriteOccurrenceIndicationColor=27,98,145' 17 | 'LSP4ETextOccurrenceIndicationColor=27,98,145' 18 | } 19 | 20 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/ContentTypeToLanguageServerDefinition.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2016-2017 Rogue Wave Software Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Michał Niewrzał (Rogue Wave Software Inc.) - initial implementation 11 | * Mickael Istria (Red Hat Inc.) - Introduce LanguageServerDefinition 12 | *******************************************************************************/ 13 | package org.eclipse.lsp4e; 14 | 15 | import java.net.URI; 16 | import java.util.AbstractMap.SimpleEntry; 17 | 18 | import org.eclipse.core.runtime.content.IContentType; 19 | import org.eclipse.jdt.annotation.Nullable; 20 | import org.eclipse.lsp4e.LanguageServersRegistry.LanguageServerDefinition; 21 | import org.eclipse.lsp4e.enablement.EnablementTester; 22 | 23 | public class ContentTypeToLanguageServerDefinition extends SimpleEntry { 24 | 25 | private static final long serialVersionUID = 6002703726009331762L; 26 | private final @Nullable EnablementTester enablement; 27 | 28 | public ContentTypeToLanguageServerDefinition(IContentType contentType, LanguageServerDefinition provider, 29 | @Nullable EnablementTester enablement) { 30 | super(contentType, provider); 31 | this.enablement = enablement; 32 | } 33 | 34 | public boolean isEnabled(@Nullable URI uri) { 35 | return isUserEnabled() && isExtensionEnabled(uri); 36 | } 37 | 38 | public void setUserEnabled(boolean enabled) { 39 | LanguageServerPlugin.getDefault().getPreferenceStore().setValue(getPreferencesKey(), String.valueOf(enabled)); 40 | } 41 | 42 | public boolean isUserEnabled() { 43 | if (LanguageServerPlugin.getDefault().getPreferenceStore().contains(getPreferencesKey())) { 44 | return LanguageServerPlugin.getDefault().getPreferenceStore().getBoolean(getPreferencesKey()); 45 | } 46 | return true; 47 | } 48 | 49 | public boolean isExtensionEnabled(@Nullable URI uri) { 50 | return enablement != null ? enablement.evaluate(uri) : true; 51 | } 52 | 53 | public @Nullable EnablementTester getEnablementCondition() { 54 | return enablement; 55 | } 56 | 57 | private String getPreferencesKey() { 58 | return getValue().id + "/" + getKey().getId(); //$NON-NLS-1$ 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/HasLanguageServerPropertyTester.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2017, 2018 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Mickael Istria (Red Hat Inc.) - initial implementation 11 | * Martin Lippert (Pivotal Inc.) - bug 531167 12 | *******************************************************************************/ 13 | package org.eclipse.lsp4e; 14 | 15 | import org.eclipse.core.expressions.PropertyTester; 16 | import org.eclipse.core.resources.IFile; 17 | import org.eclipse.jdt.annotation.Nullable; 18 | import org.eclipse.jface.text.IDocument; 19 | import org.eclipse.jface.text.ITextViewer; 20 | import org.eclipse.lsp4e.ui.UI; 21 | import org.eclipse.ui.IEditorInput; 22 | import org.eclipse.ui.IEditorPart; 23 | 24 | public class HasLanguageServerPropertyTester extends PropertyTester { 25 | 26 | @Override 27 | public boolean test(@Nullable Object receiver, String property, Object[] args, @Nullable Object expectedValue) { 28 | if (receiver instanceof IFile file) { 29 | return LanguageServersRegistry.getInstance().canUseLanguageServer(file); 30 | } else if (receiver instanceof IEditorInput editorInput) { 31 | return LanguageServersRegistry.getInstance().canUseLanguageServer(editorInput); 32 | } else if (receiver instanceof IDocument document) { 33 | return LanguageServersRegistry.getInstance().canUseLanguageServer(document); 34 | } else if (receiver instanceof ITextViewer viewer) { 35 | return test(viewer); 36 | } else if (receiver instanceof IEditorPart part) { 37 | return test(UI.asTextViewer(part)); 38 | } 39 | return false; 40 | } 41 | 42 | private boolean test(@Nullable ITextViewer viewer) { 43 | if (viewer != null) { 44 | IDocument document = viewer.getDocument(); 45 | if (document != null) { 46 | return LanguageServersRegistry.getInstance().canUseLanguageServer(document); 47 | } 48 | } 49 | return false; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/IMarkerAttributeComputer.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2016, 2017 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Rubén Porras Campo (Avaloq) - extracted to separate file 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e; 13 | 14 | import java.util.Map; 15 | 16 | import org.eclipse.core.resources.IResource; 17 | import org.eclipse.jdt.annotation.Nullable; 18 | import org.eclipse.jface.text.IDocument; 19 | import org.eclipse.lsp4j.Diagnostic; 20 | import org.eclipse.lsp4j.jsonrpc.messages.Either; 21 | 22 | /** 23 | * An interface that allows adding custom attributes to a 24 | * {@link org.eclipse.core.resources.IMarker}. 25 | * 26 | */ 27 | public interface IMarkerAttributeComputer { 28 | 29 | /** 30 | * Adds new attributes to a marker for the given document, diagnostic and 31 | * resource. 32 | * 33 | * @param diagnostic 34 | * the {@link Diagnostic} to me mapped to a marker 35 | * @param document 36 | * the {@link IDocument} attached to the given resource 37 | * @param resource 38 | * the {@link IResource} that contains the document 39 | * @param attributes 40 | * the map with the attributes for the marker, where the 41 | * implementation can add attributes 42 | */ 43 | void addMarkerAttributesForDiagnostic(Diagnostic diagnostic, @Nullable IDocument document, 44 | IResource resource, Map attributes); 45 | 46 | /** 47 | * Computes a string to be used as Marker message. 48 | */ 49 | default String computeMarkerMessage(Diagnostic diagnostic) { 50 | final Either code = diagnostic.getCode(); 51 | return code == null // 52 | ? diagnostic.getMessage() 53 | : diagnostic.getMessage() + " [" + code.get() + "]"; //$NON-NLS-1$//$NON-NLS-2$ 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/LanguageClientImpl.java: -------------------------------------------------------------------------------- 1 | package org.eclipse.lsp4e; 2 | 3 | import org.eclipse.lsp4e.client.DefaultLanguageClient; 4 | 5 | /** 6 | * This class is deprecated, and only present to avoid breaking 7 | * existing code due to the refactor done to make the previous 8 | * class officially available as API. 9 | *

10 | * Use {@link DefaultLanguageClient} instead. 11 | */ 12 | @Deprecated(forRemoval = true) 13 | public class LanguageClientImpl extends DefaultLanguageClient { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/Versioned.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022-3 Cocotec Ltd and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Ahmed Hussain (Cocotec Ltd) - initial implementation 11 | * 12 | *******************************************************************************/ 13 | package org.eclipse.lsp4e; 14 | 15 | import org.eclipse.jface.text.IDocument; 16 | import org.eclipse.lsp4e.internal.DocumentUtil; 17 | 18 | /** 19 | * Bundles together a result from a language server with the document version at the time it was run. 20 | * Supports optimistic locking. 21 | * 22 | * @param 23 | */ 24 | public class Versioned { 25 | protected final IDocument document; 26 | public final long sourceDocumentVersion; 27 | public final T data; 28 | 29 | /** 30 | * Constructs a new Versioned for the given document, and specify source version 31 | */ 32 | public Versioned(final IDocument document, long sourceDocumentVersion, final T data) { 33 | this.document = document; 34 | this.sourceDocumentVersion = sourceDocumentVersion; 35 | this.data = data; 36 | } 37 | 38 | /** 39 | * Constructs a new Versioned for the given document, using its current modification 40 | * stamp as source version. 41 | */ 42 | public Versioned(final IDocument document, final T data) { 43 | this(document, DocumentUtil.getDocumentModificationStamp(document), data); 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/VersionedEdits.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022-3 Cocotec Ltd and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Ahmed Hussain (Cocotec Ltd) - initial implementation 11 | * 12 | *******************************************************************************/ 13 | package org.eclipse.lsp4e; 14 | 15 | import java.util.ConcurrentModificationException; 16 | import java.util.List; 17 | 18 | import org.eclipse.jface.text.BadLocationException; 19 | import org.eclipse.jface.text.IDocument; 20 | import org.eclipse.lsp4e.internal.DocumentUtil; 21 | import org.eclipse.lsp4j.TextEdit; 22 | 23 | /** 24 | * Specialization of Versioned for document edits specifically 25 | * 26 | */ 27 | public class VersionedEdits extends Versioned> { 28 | 29 | public VersionedEdits(long version, List data, IDocument document) { 30 | super(document, version, data); 31 | } 32 | 33 | /** 34 | * Apply the edits from the server, provided the document is unchanged since the request used 35 | * to compute the edits 36 | * 37 | * @throws BadLocationException 38 | * @throws ConcurrentModificationException if the document has changed since the server 39 | * received the request 40 | */ 41 | public void apply() throws BadLocationException, ConcurrentModificationException { 42 | if (this.sourceDocumentVersion != DocumentUtil.getDocumentModificationStamp(this.document)) { 43 | throw new ConcurrentModificationException(); 44 | } else { 45 | LSPEclipseUtils.applyEdits(this.document, data); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/callhierarchy/CallHierarchyCommandHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Avaloq Group AG (http://www.avaloq.com). 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Andrew Lamb (Avaloq Group AG) - Initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.callhierarchy; 13 | 14 | import org.eclipse.core.commands.ExecutionEvent; 15 | import org.eclipse.jdt.annotation.Nullable; 16 | import org.eclipse.jface.text.IDocument; 17 | import org.eclipse.jface.text.ITextSelection; 18 | import org.eclipse.lsp4e.LSPEclipseUtils; 19 | import org.eclipse.lsp4e.LanguageServerPlugin; 20 | import org.eclipse.lsp4e.internal.LSPDocumentAbstractHandler; 21 | import org.eclipse.lsp4e.ui.UI; 22 | import org.eclipse.lsp4j.ServerCapabilities; 23 | import org.eclipse.ui.PartInitException; 24 | import org.eclipse.ui.texteditor.ITextEditor; 25 | 26 | /** 27 | * Command handler for the LSP call hierarchy view. 28 | */ 29 | public class CallHierarchyCommandHandler extends LSPDocumentAbstractHandler { 30 | 31 | @Override 32 | protected void execute(ExecutionEvent event, ITextEditor editor) { 33 | IDocument document = LSPEclipseUtils.getDocument(editor); 34 | if (document == null) { 35 | return; 36 | } 37 | if (editor.getSelectionProvider().getSelection() instanceof ITextSelection sel) { 38 | int offset = sel.getOffset(); 39 | 40 | try { 41 | CallHierarchyView theView = UI.showView(CallHierarchyView.ID); 42 | theView.initialize(document, offset); 43 | } catch (PartInitException e) { 44 | LanguageServerPlugin.logError("Error while opening the Call Hierarchy view", e); //$NON-NLS-1$ 45 | } 46 | } 47 | } 48 | 49 | @Override 50 | public void setEnabled(final @Nullable Object evaluationContext) { 51 | setEnabled(ServerCapabilities::getCallHierarchyProvider, this::hasSelection); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/callhierarchy/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.callhierarchy; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/client/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.client; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/command/internal/CommandConverter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Fraunhofer FOKUS and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.command.internal; 10 | 11 | import org.eclipse.core.commands.AbstractParameterValueConverter; 12 | import org.eclipse.core.commands.ParameterValueConversionException; 13 | import org.eclipse.jdt.annotation.Nullable; 14 | import org.eclipse.lsp4j.Command; 15 | 16 | import com.google.gson.Gson; 17 | import com.google.gson.GsonBuilder; 18 | 19 | /** 20 | * This converter can be used to serialize/deserialize instances of LSP {@link Command}s. 21 | */ 22 | public class CommandConverter extends AbstractParameterValueConverter { 23 | 24 | private final Gson gson; 25 | 26 | public CommandConverter() { 27 | this.gson = new GsonBuilder().create(); 28 | } 29 | 30 | @Override 31 | public @Nullable Object convertToObject(@Nullable String parameterValue) throws ParameterValueConversionException { 32 | return gson.fromJson(parameterValue, Command.class); 33 | } 34 | 35 | @Override 36 | public String convertToString(@Nullable Object parameterValue) throws ParameterValueConversionException { 37 | return gson.toJson(parameterValue); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/command/internal/CommandEventParameter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Fraunhofer FOKUS and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.command.internal; 10 | 11 | import java.util.Collections; 12 | 13 | import org.eclipse.core.commands.IParameter; 14 | import org.eclipse.core.commands.IParameterValues; 15 | import org.eclipse.core.commands.ITypedParameter; 16 | import org.eclipse.core.commands.ParameterType; 17 | import org.eclipse.core.commands.ParameterValuesException; 18 | 19 | /** 20 | * This parameter class is needed for defining an Eclipse command (a handler can 21 | * be registered for) for an LSP Command. 22 | */ 23 | public class CommandEventParameter implements IParameter, ITypedParameter { 24 | 25 | private final ParameterType paramType; 26 | private final String name; 27 | private final String id; 28 | 29 | public CommandEventParameter(ParameterType paramType, String name, String id) { 30 | super(); 31 | this.paramType = paramType; 32 | this.name = name; 33 | this.id = id; 34 | } 35 | 36 | @Override 37 | public ParameterType getParameterType() { 38 | return paramType; 39 | } 40 | 41 | @Override 42 | public String getId() { 43 | return id; 44 | } 45 | 46 | @Override 47 | public String getName() { 48 | return name; 49 | } 50 | 51 | @Override 52 | public IParameterValues getValues() throws ParameterValuesException { 53 | return Collections::emptyMap; 54 | } 55 | 56 | @Override 57 | public boolean isOptional() { 58 | return false; 59 | } 60 | 61 | } -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/command/internal/PathConverter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Fraunhofer FOKUS and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.command.internal; 10 | 11 | import java.util.Objects; 12 | 13 | import org.eclipse.core.commands.AbstractParameterValueConverter; 14 | import org.eclipse.core.commands.ParameterValueConversionException; 15 | import org.eclipse.core.runtime.IPath; 16 | import org.eclipse.core.runtime.Path; 17 | import org.eclipse.jdt.annotation.Nullable; 18 | 19 | /** 20 | * Serializes {@link IPath} instances and de-serializes them to {@link Path} instances. 21 | */ 22 | public class PathConverter extends AbstractParameterValueConverter { 23 | 24 | @Override 25 | public @Nullable Object convertToObject(@Nullable String parameterValue) throws ParameterValueConversionException { 26 | return parameterValue == null ? null : new Path(parameterValue); 27 | } 28 | 29 | @Override 30 | public String convertToString(@Nullable Object parameterValue) throws ParameterValueConversionException { 31 | return Objects.toString(parameterValue); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/command/internal/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.command.internal; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/command/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.command; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/enablement/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.enablement; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/format/DefaultFormatRegionsProvider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Contributors to the Eclipse Foundation. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * See git history 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.format; 13 | 14 | import org.eclipse.jdt.annotation.Nullable; 15 | import org.eclipse.jface.text.IDocument; 16 | import org.eclipse.jface.text.IRegion; 17 | import org.osgi.service.component.annotations.Component; 18 | 19 | /** 20 | * Default OSGi service implementation if no bundle provides a OSGi service for {@link IFormatRegionsProvider}. 21 | * 22 | */ 23 | @Component 24 | public class DefaultFormatRegionsProvider implements IFormatRegionsProvider { 25 | 26 | @Override 27 | public IRegion @Nullable [] getFormattingRegions(IDocument document) { 28 | // return null until user can disable the format-on-save feature in LSP4E. 29 | return null; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/format/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.format; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/internal/CancellationUtil.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Avaloq Group AG. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Rubén Porras Campo (Avaloq Group AG) - Initial Implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.internal; 13 | 14 | import java.util.concurrent.CancellationException; 15 | import java.util.concurrent.CompletionException; 16 | import java.util.concurrent.ExecutionException; 17 | 18 | import org.eclipse.jdt.annotation.Nullable; 19 | import org.eclipse.lsp4j.jsonrpc.ResponseErrorException; 20 | import org.eclipse.lsp4j.jsonrpc.messages.ResponseError; 21 | import org.eclipse.lsp4j.jsonrpc.messages.ResponseErrorCode; 22 | 23 | public final class CancellationUtil { 24 | 25 | private CancellationUtil() { 26 | // this class shouldn't be instantiated 27 | } 28 | 29 | public static boolean isRequestCancelledException(@Nullable Throwable throwable) { 30 | if (throwable instanceof CompletionException || throwable instanceof ExecutionException) { 31 | throwable = throwable.getCause(); 32 | } 33 | if (throwable instanceof ResponseErrorException responseErrorException) { 34 | return isRequestCancelled(responseErrorException); 35 | } 36 | return throwable instanceof CancellationException; 37 | } 38 | 39 | private static boolean isRequestCancelled(ResponseErrorException responseErrorException) { 40 | ResponseError responseError = responseErrorException.getResponseError(); 41 | return responseError != null 42 | && responseError.getCode() == ResponseErrorCode.RequestCancelled.getValue(); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/internal/DocumentInputStream.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Sebastian Thomschke and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Sebastian Thomschke - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.internal; 13 | 14 | import org.eclipse.jface.text.IDocument; 15 | 16 | public final class DocumentInputStream extends CharsInputStream { 17 | 18 | public DocumentInputStream(final IDocument doc) { 19 | super(doc::getChar, doc::getLength, DocumentUtil.getCharset(doc)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/internal/FileBufferListenerAdapter.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2016 Rogue Wave Software Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Michał Niewrzał (Rogue Wave Software Inc.) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.internal; 13 | 14 | import org.eclipse.core.filebuffers.IFileBuffer; 15 | import org.eclipse.core.filebuffers.IFileBufferListener; 16 | import org.eclipse.core.runtime.IPath; 17 | 18 | public class FileBufferListenerAdapter implements IFileBufferListener { 19 | 20 | @Override 21 | public void bufferCreated(IFileBuffer buffer) { 22 | } 23 | 24 | @Override 25 | public void bufferDisposed(IFileBuffer buffer) { 26 | } 27 | 28 | @Override 29 | public void bufferContentAboutToBeReplaced(IFileBuffer buffer) { 30 | } 31 | 32 | @Override 33 | public void bufferContentReplaced(IFileBuffer buffer) { 34 | } 35 | 36 | @Override 37 | public void stateChanging(IFileBuffer buffer) { 38 | } 39 | 40 | @Override 41 | public void dirtyStateChanged(IFileBuffer buffer, boolean isDirty) { 42 | } 43 | 44 | @Override 45 | public void stateValidationChanged(IFileBuffer buffer, boolean isStateValidated) { 46 | } 47 | 48 | @Override 49 | public void underlyingFileMoved(IFileBuffer buffer, IPath path) { 50 | } 51 | 52 | @Override 53 | public void underlyingFileDeleted(IFileBuffer buffer) { 54 | } 55 | 56 | @Override 57 | public void stateChangeFailed(IFileBuffer buffer) { 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/internal/Pair.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Avaloq Group AG. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Rubén Porras Campo (Avaloq Group AG) - Initial Implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.internal; 13 | 14 | public record Pair(F first, S second) { 15 | 16 | public static Pair of(final F first, final S second) { 17 | return new Pair<>(first, second); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/internal/StyleUtil.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Avaloq Group AG. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Rubén Porras Campo (Avaloq Group AG) - Initial Implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.internal; 13 | 14 | import org.eclipse.jface.viewers.StyledString.Styler; 15 | import org.eclipse.swt.graphics.TextStyle; 16 | 17 | public class StyleUtil { 18 | 19 | private StyleUtil() { 20 | // this class shouldn't be instantiated 21 | } 22 | 23 | public static final Styler DEPRECATE = new Styler() { 24 | @Override 25 | public void applyStyles(final TextStyle textStyle) { 26 | textStyle.strikeout = true; 27 | } 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/internal/ThrowingConsumer.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Sebastian Thomschke and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Sebastian Thomschke - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.internal; 13 | 14 | import java.util.function.Consumer; 15 | 16 | /** 17 | * @author Sebastian Thomschke 18 | */ 19 | @FunctionalInterface 20 | public interface ThrowingConsumer extends Consumer { 21 | 22 | static ThrowingConsumer from(final Consumer consumer) { 23 | return consumer::accept; 24 | } 25 | 26 | @Override 27 | default void accept(final I elem) { 28 | try { 29 | acceptOrThrow(elem); 30 | } catch (final RuntimeException rex) { 31 | throw rex; 32 | } catch (final Throwable t) { 33 | throw new RuntimeException(t); 34 | } 35 | } 36 | 37 | void acceptOrThrow(I elem) throws X; 38 | } 39 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/internal/ThrowingPredicate.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2024 Sebastian Thomschke and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Sebastian Thomschke - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.internal; 13 | 14 | import java.util.function.Predicate; 15 | 16 | @FunctionalInterface 17 | public interface ThrowingPredicate extends Predicate { 18 | 19 | static ThrowingPredicate from(final Predicate predicate) { 20 | return predicate::test; 21 | } 22 | 23 | @Override 24 | default boolean test(final I elem) { 25 | try { 26 | return testOrThrow(elem); 27 | } catch (final RuntimeException rex) { 28 | throw rex; 29 | } catch (final Throwable t) { 30 | throw new RuntimeException(t); 31 | } 32 | } 33 | 34 | boolean testOrThrow(I elem) throws X; 35 | } -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/internal/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.internal; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/codeactions/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.codeactions; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/codelens/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.codelens; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/color/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.color; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/completion/LSCompletionProposalComparator.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2016, 2019 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Mickael Istria (Red Hat Inc.) - initial implementation 11 | * Michał Niewrzał (Rogue Wave Software Inc.) 12 | * Lucas Bullen (Red Hat Inc.) - Refactored for incomplete completion lists 13 | *******************************************************************************/ 14 | package org.eclipse.lsp4e.operations.completion; 15 | 16 | import java.util.Comparator; 17 | 18 | import org.eclipse.jface.text.BadLocationException; 19 | import org.eclipse.lsp4e.LanguageServerPlugin; 20 | 21 | final class LSCompletionProposalComparator implements Comparator { 22 | @Override 23 | public int compare(LSCompletionProposal o1, LSCompletionProposal o2) { 24 | try { 25 | int docFilterLen1 = o1.getDocumentFilter().length(); 26 | int docFilterLen2 = o2.getDocumentFilter().length(); 27 | if (docFilterLen1 > docFilterLen2) { 28 | return -1; 29 | } else if (docFilterLen1 < docFilterLen2) { 30 | return +1; 31 | } 32 | } catch (BadLocationException e) { 33 | LanguageServerPlugin.logError(e); 34 | } 35 | if (o1.getRankCategory() < o2.getRankCategory()) { 36 | return -1; 37 | } else if (o1.getRankCategory() > o2.getRankCategory()) { 38 | return +1; 39 | } 40 | if ((o1.getRankCategory() < 5 && o2.getRankCategory() < 5) 41 | && (!(o1.getRankScore() == -1 && o2.getRankScore() == -1))) { 42 | if (o2.getRankScore() == -1 || o1.getRankScore() < o2.getRankScore()) { 43 | return -1; 44 | } else if (o1.getRankScore() == -1 || o1.getRankScore() > o2.getRankScore()) { 45 | return +1; 46 | } 47 | } 48 | String c1 = o1.getSortText(); 49 | String c2 = o2.getSortText(); 50 | if (c1 == null) { 51 | return -1; 52 | } 53 | return c1.compareToIgnoreCase(c2); 54 | } 55 | } -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/completion/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.completion; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/declaration/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.declaration; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/diagnostics/DiagnosticAnnotation.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Mickael Istria (Red Hat Inc.) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.operations.diagnostics; 13 | 14 | import java.util.function.Function; 15 | 16 | import org.eclipse.jdt.annotation.Nullable; 17 | import org.eclipse.jface.text.source.Annotation; 18 | import org.eclipse.lsp4j.Diagnostic; 19 | 20 | class DiagnosticAnnotation extends Annotation { 21 | 22 | private final Diagnostic diagnostic; 23 | private final Function textComputer; 24 | 25 | public DiagnosticAnnotation(Diagnostic diagnostic, Function textComputer) { 26 | this.diagnostic = diagnostic; 27 | this.textComputer = textComputer; 28 | } 29 | 30 | @Override 31 | public String getType() { 32 | return switch (diagnostic.getSeverity()) { 33 | case Error -> "org.eclipse.ui.workbench.texteditor.error"; //$NON-NLS-1$ 34 | case Warning -> "org.eclipse.ui.workbench.texteditor.warning"; //$NON-NLS-1$ 35 | case Information -> "org.eclipse.ui.workbench.texteditor.info"; //$NON-NLS-1$ 36 | case Hint -> "org.eclipse.ui.workbench.texteditor.info"; //$NON-NLS-1$ 37 | }; 38 | } 39 | 40 | @Override 41 | public void setType(@Nullable String type) { 42 | throw new UnsupportedOperationException(); 43 | } 44 | 45 | @Override 46 | public String getText() { 47 | return textComputer.apply(diagnostic); 48 | } 49 | 50 | @Override 51 | public void setText(@Nullable String text) { 52 | throw new UnsupportedOperationException(); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/diagnostics/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.diagnostics; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/documentLink/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.documentLink; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/folding/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.folding; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/format/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.format; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/highlight/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.highlight; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/hover/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.hover; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/inlayhint/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.inlayhint; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/linkedediting/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.linkedediting; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/references/LSFindReferences.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2016-2023 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Mickael Istria (Red Hat Inc.) - initial implementation 11 | * Michał Niewrzał (Rogue Wave Software Inc.) 12 | * Angelo Zerr - fix Bug 526255 13 | *******************************************************************************/ 14 | package org.eclipse.lsp4e.operations.references; 15 | 16 | import org.eclipse.core.commands.ExecutionEvent; 17 | import org.eclipse.core.commands.IHandler; 18 | import org.eclipse.jdt.annotation.Nullable; 19 | import org.eclipse.jface.text.IDocument; 20 | import org.eclipse.jface.text.ITextSelection; 21 | import org.eclipse.jface.viewers.ISelection; 22 | import org.eclipse.lsp4e.LSPEclipseUtils; 23 | import org.eclipse.lsp4e.LanguageServerPlugin; 24 | import org.eclipse.lsp4e.internal.LSPDocumentAbstractHandler; 25 | import org.eclipse.lsp4e.ui.UI; 26 | import org.eclipse.lsp4j.ServerCapabilities; 27 | import org.eclipse.search.ui.NewSearchUI; 28 | import org.eclipse.ui.texteditor.ITextEditor; 29 | 30 | /** 31 | * LSP "Find references" handler. 32 | * 33 | */ 34 | public class LSFindReferences extends LSPDocumentAbstractHandler implements IHandler { 35 | 36 | @Override 37 | protected void execute(ExecutionEvent event, ITextEditor textEditor) { 38 | ISelection sel = textEditor.getSelectionProvider().getSelection(); 39 | if (sel instanceof ITextSelection textSelection) { 40 | IDocument document = LSPEclipseUtils.getDocument(textEditor); 41 | if (document != null) { 42 | try { 43 | final var query = new LSSearchQuery(textSelection.getOffset(), document); 44 | UI.getDisplay().asyncExec(() -> NewSearchUI.runQueryInBackground(query)); 45 | } catch (Exception e) { 46 | LanguageServerPlugin.logError(e); 47 | } 48 | } 49 | } 50 | } 51 | 52 | @Override 53 | public void setEnabled(@Nullable Object evaluationContext) { 54 | setEnabled(ServerCapabilities::getReferencesProvider, this::hasSelection); 55 | } 56 | 57 | @Override 58 | public boolean isHandled() { 59 | return true; 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/references/URIMatch.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.operations.references; 10 | 11 | import static org.eclipse.lsp4e.internal.NullSafetyHelper.castNonNull; 12 | 13 | import java.net.URI; 14 | import java.net.URISyntaxException; 15 | 16 | import org.eclipse.jface.text.BadLocationException; 17 | import org.eclipse.jface.text.IDocument; 18 | import org.eclipse.lsp4e.LSPEclipseUtils; 19 | import org.eclipse.lsp4j.Location; 20 | import org.eclipse.search.ui.text.Match; 21 | 22 | public class URIMatch extends Match { 23 | 24 | public static URIMatch create(final Location location) throws BadLocationException, URISyntaxException { 25 | final URI uri = new URI(location.getUri()); 26 | final IDocument doc = castNonNull(LSPEclipseUtils.getDocument(uri)); 27 | final int offset = LSPEclipseUtils.toOffset(location.getRange().getStart(), doc); 28 | final int length = LSPEclipseUtils.toOffset(location.getRange().getEnd(), doc) - LSPEclipseUtils.toOffset(location.getRange().getStart(), doc); 29 | return new URIMatch(location, uri, offset, length); 30 | } 31 | 32 | public final Location location; 33 | 34 | protected URIMatch(final Location location, final URI uri, final int offset, final int length) { 35 | super(uri, offset, length); 36 | this.location = location; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/references/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.references; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/rename/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.rename; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/selectionRange/LSPSelectionRangeDownHandler.java: -------------------------------------------------------------------------------- 1 | package org.eclipse.lsp4e.operations.selectionRange; 2 | 3 | /******************************************************************************* 4 | * Copyright (c) 2023 Red Hat Inc. and others. 5 | * This program and the accompanying materials are made 6 | * available under the terms of the Eclipse Public License 2.0 7 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 8 | * 9 | * SPDX-License-Identifier: EPL-2.0 10 | * 11 | * Contributors: 12 | * Angelo ZERR (Red Hat Inc.) - initial implementation 13 | *******************************************************************************/ 14 | import org.eclipse.lsp4e.operations.selectionRange.LSPSelectionRangeAbstractHandler.SelectionRangeHandler.Direction; 15 | /** 16 | * Selection range DOWN handler. 17 | * 18 | * @author Angelo ZERR 19 | * 20 | */ 21 | public class LSPSelectionRangeDownHandler extends LSPSelectionRangeAbstractHandler { 22 | 23 | @Override 24 | protected Direction getDirection() { 25 | return Direction.DOWN; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/selectionRange/LSPSelectionRangeUpHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Angelo ZERR (Red Hat Inc.) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.operations.selectionRange; 13 | 14 | import org.eclipse.lsp4e.operations.selectionRange.LSPSelectionRangeAbstractHandler.SelectionRangeHandler.Direction; 15 | 16 | /** 17 | * Selection range UP handler. 18 | * 19 | * @author Angelo ZERR 20 | * 21 | */ 22 | public class LSPSelectionRangeUpHandler extends LSPSelectionRangeAbstractHandler { 23 | 24 | @Override 25 | protected Direction getDirection() { 26 | return Direction.UP; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/selectionRange/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.selectionRange; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/semanticTokens/VersionedSemanticTokens.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Avaloq Group AG. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Rubén Porras Campo (Avaloq Group AG) - Initial Implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.operations.semanticTokens; 13 | 14 | import java.util.function.Consumer; 15 | import java.util.function.LongConsumer; 16 | 17 | import org.eclipse.jdt.annotation.Nullable; 18 | import org.eclipse.jface.text.IDocument; 19 | import org.eclipse.lsp4e.Versioned; 20 | import org.eclipse.lsp4e.internal.DocumentUtil; 21 | import org.eclipse.lsp4e.internal.Pair; 22 | import org.eclipse.lsp4j.SemanticTokens; 23 | import org.eclipse.lsp4j.SemanticTokensLegend; 24 | 25 | /** 26 | * Specialization of Versioned for semanticTokens 27 | */ 28 | public class VersionedSemanticTokens extends Versioned>{ 29 | 30 | public VersionedSemanticTokens(long version, Pair<@Nullable SemanticTokens, @Nullable SemanticTokensLegend> data, 31 | IDocument document) { 32 | super(document, version, data); 33 | } 34 | 35 | /** 36 | * Apply the semantic tokens from the server, provided the document is unchanged since the request used 37 | * to compute the edits 38 | * 39 | */ 40 | public void apply(Consumer> first, LongConsumer second) { 41 | if (sourceDocumentVersion == DocumentUtil.getDocumentModificationStamp(document)) { 42 | first.accept(data); 43 | second.accept(sourceDocumentVersion); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/semanticTokens/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.semanticTokens; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/symbols/LSPSymbolInFileHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2016 Rogue Wave Software Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Michał Niewrzał (Rogue Wave Software Inc.) - initial implementation 11 | * Lucas Bullen (Red Hat Inc.) - [Bug 517428] Requests sent before initialization 12 | *******************************************************************************/ 13 | package org.eclipse.lsp4e.operations.symbols; 14 | 15 | import java.util.concurrent.CompletableFuture; 16 | 17 | import org.eclipse.core.commands.ExecutionEvent; 18 | import org.eclipse.jdt.annotation.Nullable; 19 | import org.eclipse.jface.text.IDocument; 20 | import org.eclipse.lsp4e.LSPEclipseUtils; 21 | import org.eclipse.lsp4e.LanguageServers; 22 | import org.eclipse.lsp4e.internal.LSPDocumentAbstractHandler; 23 | import org.eclipse.lsp4j.ServerCapabilities; 24 | import org.eclipse.swt.widgets.Shell; 25 | import org.eclipse.ui.handlers.HandlerUtil; 26 | import org.eclipse.ui.texteditor.ITextEditor; 27 | 28 | public class LSPSymbolInFileHandler extends LSPDocumentAbstractHandler { 29 | 30 | @Override 31 | protected void execute(ExecutionEvent event, ITextEditor textEditor) { 32 | final IDocument document = LSPEclipseUtils.getDocument(textEditor); 33 | if (document == null) { 34 | return; 35 | } 36 | 37 | final Shell shell = HandlerUtil.getActiveShell(event); 38 | 39 | if (shell == null) { 40 | return; 41 | } 42 | 43 | // TODO maybe consider better strategy such as iterating on all LS until we have 44 | // a good result 45 | LanguageServers.forDocument(document).withCapability(ServerCapabilities::getDocumentSymbolProvider) 46 | .computeFirst((w, ls) -> CompletableFuture.completedFuture(w)) // 47 | .thenAcceptAsync( 48 | oW -> oW.ifPresent(w -> new LSPSymbolInFileDialog(shell, textEditor, document, w).open()), 49 | shell.getDisplay()); 50 | } 51 | 52 | @Override 53 | public void setEnabled(@Nullable Object evaluationContext) { 54 | setEnabled(ServerCapabilities::getDocumentSymbolProvider, x -> true); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/symbols/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.symbols; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/typeHierarchy/TypeHierarchyHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.operations.typeHierarchy; 10 | 11 | import java.util.concurrent.CompletableFuture; 12 | 13 | import org.eclipse.core.commands.ExecutionEvent; 14 | import org.eclipse.jdt.annotation.Nullable; 15 | import org.eclipse.jface.text.IDocument; 16 | import org.eclipse.jface.text.ITextSelection; 17 | import org.eclipse.lsp4e.LSPEclipseUtils; 18 | import org.eclipse.lsp4e.LanguageServers; 19 | import org.eclipse.lsp4e.internal.LSPDocumentAbstractHandler; 20 | import org.eclipse.lsp4j.ServerCapabilities; 21 | import org.eclipse.ui.texteditor.ITextEditor; 22 | 23 | public class TypeHierarchyHandler extends LSPDocumentAbstractHandler { 24 | 25 | @Override 26 | protected void execute(ExecutionEvent event, ITextEditor editor) { 27 | IDocument document = LSPEclipseUtils.getDocument(editor); 28 | if (document != null) { 29 | LanguageServers.forDocument(document) 30 | .withCapability(ServerCapabilities::getTypeHierarchyProvider) 31 | .computeFirst((wrapper, ls) -> CompletableFuture.completedFuture(wrapper.serverDefinition)) 32 | .thenAcceptAsync(definition -> definition.ifPresent(def -> new TypeHierarchyDialog(editor.getSite().getShell(), (ITextSelection)editor.getSelectionProvider().getSelection(), document, def).open()), editor.getSite().getShell().getDisplay()); 33 | } 34 | } 35 | 36 | @Override 37 | public void setEnabled(@Nullable Object evaluationContext) { 38 | setEnabled(ServerCapabilities::getTypeDefinitionProvider, editor -> true); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/typeHierarchy/TypeHierarchyItemLabelProvider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | *******************************************************************************/ 9 | package org.eclipse.lsp4e.operations.typeHierarchy; 10 | 11 | import org.eclipse.jdt.annotation.Nullable; 12 | import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; 13 | import org.eclipse.jface.viewers.LabelProvider; 14 | import org.eclipse.jface.viewers.StyledString; 15 | import org.eclipse.lsp4e.ui.LSPImages; 16 | import org.eclipse.lsp4j.TypeHierarchyItem; 17 | import org.eclipse.swt.graphics.Image; 18 | 19 | public class TypeHierarchyItemLabelProvider extends LabelProvider implements IStyledLabelProvider { 20 | 21 | @Override 22 | public String getText(Object element) { 23 | if (element instanceof TypeHierarchyItem item) { 24 | return item.getName(); 25 | } 26 | return super.getText(element); 27 | } 28 | 29 | @Override 30 | public @Nullable Image getImage(@Nullable Object element) { 31 | if (element instanceof TypeHierarchyItem item) { 32 | return LSPImages.imageFromSymbolKind(item.getKind()); 33 | } 34 | return element == null ? null : super.getImage(element); 35 | } 36 | 37 | @Override 38 | public StyledString getStyledText(@Nullable Object element) { 39 | if (element instanceof TypeHierarchyItem item) { 40 | return new StyledString(item.getName()); 41 | } else if (element instanceof String s) { 42 | return new StyledString(s); 43 | } 44 | return new StyledString(); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/typeHierarchy/TypeHierarchyViewHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Bachmann electronic GmbH and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Gesa Hentschke (Bachmann electronic GmbH) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.operations.typeHierarchy; 13 | 14 | import org.eclipse.core.commands.ExecutionEvent; 15 | import org.eclipse.jdt.annotation.Nullable; 16 | import org.eclipse.jface.text.IDocument; 17 | import org.eclipse.jface.text.ITextSelection; 18 | import org.eclipse.lsp4e.LSPEclipseUtils; 19 | import org.eclipse.lsp4e.LanguageServerPlugin; 20 | import org.eclipse.lsp4e.callhierarchy.CallHierarchyCommandHandler; 21 | import org.eclipse.lsp4e.ui.UI; 22 | import org.eclipse.lsp4j.ServerCapabilities; 23 | import org.eclipse.ui.PartInitException; 24 | import org.eclipse.ui.texteditor.ITextEditor; 25 | 26 | /** 27 | * Command handler for the LSP type hierarchy view. 28 | */ 29 | public class TypeHierarchyViewHandler extends CallHierarchyCommandHandler { 30 | 31 | @Override 32 | protected void execute(ExecutionEvent event, ITextEditor editor) { 33 | IDocument document = LSPEclipseUtils.getDocument(editor); 34 | if (document == null) { 35 | return; 36 | } 37 | if (editor.getSelectionProvider().getSelection() instanceof ITextSelection sel) { 38 | int offset = sel.getOffset(); 39 | try { 40 | final TypeHierarchyView view = UI.showView(TypeHierarchyView.ID); 41 | view.initialize(document, offset); 42 | } catch (PartInitException e) { 43 | LanguageServerPlugin.logError("Error while opening the Type Hierarchy view", e); //$NON-NLS-1$ 44 | } 45 | } 46 | } 47 | 48 | @Override 49 | public void setEnabled(@Nullable Object evaluationContext) { 50 | setEnabled(ServerCapabilities::getTypeHierarchyProvider, this::hasSelection); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/typeHierarchy/TypeMemberContentProvider.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2023 Bachmann electronic GmbH and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Gesa Hentschke (Bachmann electronic GmbH) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.operations.typeHierarchy; 13 | 14 | 15 | import static org.eclipse.lsp4e.internal.ArrayUtil.NO_OBJECTS; 16 | 17 | import java.net.URI; 18 | import java.util.List; 19 | 20 | import org.eclipse.jdt.annotation.Nullable; 21 | import org.eclipse.jface.viewers.IStructuredContentProvider; 22 | import org.eclipse.lsp4e.outline.SymbolsModel.DocumentSymbolWithURI; 23 | import org.eclipse.lsp4j.DocumentSymbol; 24 | 25 | public class TypeMemberContentProvider implements IStructuredContentProvider { 26 | 27 | @Override 28 | public Object[] getElements(@Nullable Object inputElement) { 29 | if (inputElement instanceof DocumentSymbolWithURI symbolContainer) { 30 | return toContainer(symbolContainer.symbol.getChildren(), symbolContainer.uri); 31 | } 32 | return NO_OBJECTS; 33 | } 34 | 35 | private Object[] toContainer(@Nullable List symbols, URI uri) { 36 | if (symbols != null) { 37 | var container = new DocumentSymbolWithURI[symbols.size()]; 38 | for (int i = 0; i < symbols.size(); i++) { 39 | container[i] = new DocumentSymbolWithURI(symbols.get(i), uri); 40 | } 41 | return container; 42 | } 43 | return NO_OBJECTS; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/typeHierarchy/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.operations.typeHierarchy; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/outline/CollapseAllOutlineHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2025 Vegard IT GmbH and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Sebastian Thomschke (Vegard IT GmbH) - initial implementation. 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.outline; 13 | 14 | import org.eclipse.core.commands.AbstractHandler; 15 | import org.eclipse.core.commands.ExecutionEvent; 16 | import org.eclipse.jdt.annotation.Nullable; 17 | import org.eclipse.lsp4e.ui.UI; 18 | import org.eclipse.ui.views.contentoutline.ContentOutline; 19 | 20 | public class CollapseAllOutlineHandler extends AbstractHandler { 21 | 22 | @Override 23 | public @Nullable Object execute(ExecutionEvent event) { 24 | final var workbenchPage = UI.getActivePage(); 25 | if (workbenchPage != null // 26 | && workbenchPage.getActivePart() instanceof ContentOutline outline 27 | && outline.getCurrentPage() instanceof CNFOutlinePage page) { 28 | page.collapseTree(); 29 | } 30 | return null; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/outline/HasCNFOutlinePage.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2018 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Lucas Bullen (Red Hat Inc.) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.outline; 13 | 14 | import org.eclipse.core.expressions.PropertyTester; 15 | import org.eclipse.jdt.annotation.Nullable; 16 | import org.eclipse.ui.IEditorPart; 17 | import org.eclipse.ui.views.contentoutline.ContentOutline; 18 | import org.eclipse.ui.views.contentoutline.IContentOutlinePage; 19 | 20 | public class HasCNFOutlinePage extends PropertyTester { 21 | 22 | @Override 23 | public boolean test(@Nullable Object receiver, String property, Object[] args, @Nullable Object expectedValue) { 24 | if (receiver instanceof ContentOutline outline) { 25 | return outline.getCurrentPage() instanceof CNFOutlinePage; 26 | } 27 | if (receiver instanceof IEditorPart editor) { 28 | IContentOutlinePage outlinePage = editor.getAdapter(IContentOutlinePage.class); 29 | return outlinePage instanceof CNFOutlinePage; 30 | } 31 | return false; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/outline/ShowKindHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2018 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Lucas Bullen (Red Hat Inc.) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.outline; 13 | 14 | import org.eclipse.core.commands.AbstractHandler; 15 | import org.eclipse.core.commands.Command; 16 | import org.eclipse.core.commands.ExecutionEvent; 17 | import org.eclipse.core.commands.ExecutionException; 18 | import org.eclipse.core.runtime.preferences.IEclipsePreferences; 19 | import org.eclipse.core.runtime.preferences.InstanceScope; 20 | import org.eclipse.jdt.annotation.Nullable; 21 | import org.eclipse.lsp4e.LanguageServerPlugin; 22 | import org.eclipse.ui.handlers.HandlerUtil; 23 | 24 | public class ShowKindHandler extends AbstractHandler { 25 | 26 | @Override 27 | public @Nullable Object execute(ExecutionEvent event) throws ExecutionException { 28 | Command command = event.getCommand(); 29 | boolean oldValue = HandlerUtil.toggleCommandState(command); 30 | 31 | IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(LanguageServerPlugin.PLUGIN_ID); 32 | preferences.putBoolean(CNFOutlinePage.SHOW_KIND_PREFERENCE, !oldValue); 33 | return null; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/outline/ToggleLinkingHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2017 Rogue Wave Software Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Michal Niewrzal (Rogue Wave Software Inc.) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.outline; 13 | 14 | import org.eclipse.core.commands.AbstractHandler; 15 | import org.eclipse.core.commands.Command; 16 | import org.eclipse.core.commands.ExecutionEvent; 17 | import org.eclipse.core.commands.ExecutionException; 18 | import org.eclipse.core.runtime.preferences.IEclipsePreferences; 19 | import org.eclipse.core.runtime.preferences.InstanceScope; 20 | import org.eclipse.jdt.annotation.Nullable; 21 | import org.eclipse.lsp4e.LanguageServerPlugin; 22 | import org.eclipse.ui.handlers.HandlerUtil; 23 | 24 | public class ToggleLinkingHandler extends AbstractHandler { 25 | 26 | @Override 27 | public @Nullable Object execute(ExecutionEvent event) throws ExecutionException { 28 | Command command = event.getCommand(); 29 | boolean oldValue = HandlerUtil.toggleCommandState(command); 30 | 31 | IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode(LanguageServerPlugin.PLUGIN_ID); 32 | preferences.putBoolean(CNFOutlinePage.LINK_WITH_EDITOR_PREFERENCE, !oldValue); 33 | return null; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/outline/ToggleSortOutlineHandler.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2021 Vegard IT GmbH and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Sebastian Thomschke (Vegard IT GmbH) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.outline; 13 | 14 | import org.eclipse.core.commands.AbstractHandler; 15 | import org.eclipse.core.commands.ExecutionEvent; 16 | import org.eclipse.core.commands.ExecutionException; 17 | import org.eclipse.core.runtime.preferences.IEclipsePreferences; 18 | import org.eclipse.core.runtime.preferences.InstanceScope; 19 | import org.eclipse.jdt.annotation.Nullable; 20 | import org.eclipse.lsp4e.LanguageServerPlugin; 21 | import org.eclipse.ui.handlers.HandlerUtil; 22 | 23 | public class ToggleSortOutlineHandler extends AbstractHandler { 24 | 25 | @Override 26 | public @Nullable Object execute(final ExecutionEvent event) throws ExecutionException { 27 | final boolean oldValue = HandlerUtil.toggleCommandState(event.getCommand()); 28 | final IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(LanguageServerPlugin.PLUGIN_ID); 29 | prefs.putBoolean(CNFOutlinePage.SORT_OUTLINE_PREFERENCE, !oldValue); 30 | return null; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/outline/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.outline; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/progress/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.progress; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/refactoring/DeleteExternalFile.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2019 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Mickael Istria (Red Hat Inc.) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.refactoring; 13 | 14 | import java.io.File; 15 | import java.io.IOException; 16 | import java.nio.file.Files; 17 | 18 | import org.eclipse.core.runtime.CoreException; 19 | import org.eclipse.core.runtime.IProgressMonitor; 20 | import org.eclipse.core.runtime.IStatus; 21 | import org.eclipse.core.runtime.Status; 22 | import org.eclipse.jdt.annotation.Nullable; 23 | import org.eclipse.lsp4e.LanguageServerPlugin; 24 | import org.eclipse.ltk.core.refactoring.Change; 25 | import org.eclipse.ltk.core.refactoring.RefactoringStatus; 26 | 27 | public class DeleteExternalFile extends Change { 28 | 29 | private final File file; 30 | 31 | public DeleteExternalFile(File file) { 32 | this.file = file; 33 | } 34 | 35 | @Override 36 | public String getName() { 37 | return "Delete " + this.file.getName(); //$NON-NLS-1$ 38 | } 39 | 40 | @Override 41 | public void initializeValidationData(IProgressMonitor pm) { 42 | // nothing to do yet, comment requested by sonar 43 | } 44 | 45 | @Override 46 | public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException { 47 | return RefactoringStatus.create(Status.OK_STATUS); 48 | } 49 | 50 | @Override 51 | public @Nullable Change perform(IProgressMonitor pm) throws CoreException { 52 | try { 53 | Files.delete(this.file.toPath()); 54 | } catch (IOException e) { 55 | LanguageServerPlugin.logError(e); 56 | throw new CoreException(new Status(IStatus.ERROR, LanguageServerPlugin.PLUGIN_ID, e.getMessage(), e)); 57 | } 58 | return null; 59 | } 60 | 61 | @Override 62 | public Object getModifiedElement() { 63 | return this.file; 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/refactoring/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.refactoring; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/server/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.server; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/ui/EnableDisableLSJob.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2018 Red Hat Inc. and others. 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Rastislav Wagner (Red Hat Inc.) - initial implementation 11 | *******************************************************************************/ 12 | package org.eclipse.lsp4e.ui; 13 | 14 | import java.util.List; 15 | 16 | import org.eclipse.core.runtime.IProgressMonitor; 17 | import org.eclipse.core.runtime.IStatus; 18 | import org.eclipse.core.runtime.Status; 19 | import org.eclipse.core.runtime.jobs.Job; 20 | import org.eclipse.jdt.annotation.Nullable; 21 | import org.eclipse.lsp4e.ContentTypeToLanguageServerDefinition; 22 | import org.eclipse.lsp4e.LanguageServiceAccessor; 23 | import org.eclipse.ui.IEditorReference; 24 | 25 | public class EnableDisableLSJob extends Job { 26 | 27 | private final List serverDefinitions; 28 | private final IEditorReference @Nullable [] editors; 29 | 30 | public EnableDisableLSJob(List serverDefinitions, 31 | IEditorReference @Nullable [] editors) { 32 | super(Messages.enableDisableLSJob); 33 | this.serverDefinitions = serverDefinitions; 34 | this.editors = editors; 35 | } 36 | 37 | @Override 38 | protected IStatus run(@Nullable IProgressMonitor monitor) { 39 | for (ContentTypeToLanguageServerDefinition changedDefinition : serverDefinitions) { 40 | if (!changedDefinition.isEnabled(null)) { 41 | LanguageServiceAccessor.disableLanguageServerContentType(changedDefinition); 42 | } else if (editors != null) { 43 | LanguageServiceAccessor.enableLanguageServerContentType(changedDefinition, editors); 44 | } 45 | } 46 | return Status.OK_STATUS; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/ui/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.ui; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/ui/views/HierarchyViewInput.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (c) 2022 Avaloq Group AG (http://www.avaloq.com). 3 | * This program and the accompanying materials are made 4 | * available under the terms of the Eclipse Public License 2.0 5 | * which is available at https://www.eclipse.org/legal/epl-2.0/ 6 | * 7 | * SPDX-License-Identifier: EPL-2.0 8 | * 9 | * Contributors: 10 | * Andrew Lamb (Avaloq Group AG) - Initial implementation 11 | * Gesa Hentschke - made the class generic 12 | *******************************************************************************/ 13 | 14 | package org.eclipse.lsp4e.ui.views; 15 | 16 | import org.eclipse.jface.text.IDocument; 17 | 18 | /** 19 | * Simple type representing the input to a hierarchy view. 20 | */ 21 | public class HierarchyViewInput { 22 | private final IDocument document; 23 | private final int offset; 24 | 25 | /** 26 | * Creates a new instance of {@link HierarchyViewInput}. 27 | * 28 | * @param document 29 | * the document containing the selection to start a hierarchy 30 | * from. 31 | * @param offset 32 | * the offset into the document to select as the root of the 33 | * hierarchy. 34 | */ 35 | public HierarchyViewInput(final IDocument document, final int offset) { 36 | this.document = document; 37 | this.offset = offset; 38 | } 39 | 40 | /** 41 | * Get the document containing the selection to start a hierarchy from. 42 | * 43 | * @return the document containing the selection to start a call hierarchy from. 44 | */ 45 | public IDocument getDocument() { 46 | return document; 47 | } 48 | 49 | /** 50 | * Get the offset into the document to select as the root of the hierarchy. 51 | * 52 | * @return the offset into the document to select as the root of the hierarchy. 53 | */ 54 | public int getOffset() { 55 | return offset; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /org.eclipse.lsp4e/src/org/eclipse/lsp4e/ui/views/package-info.java: -------------------------------------------------------------------------------- 1 | @NonNullByDefault({ ARRAY_CONTENTS, PARAMETER, RETURN_TYPE, FIELD, TYPE_BOUND, TYPE_ARGUMENT }) 2 | package org.eclipse.lsp4e.ui.views; 3 | 4 | import static org.eclipse.jdt.annotation.DefaultLocation.*; 5 | 6 | import org.eclipse.jdt.annotation.NonNullByDefault; 7 | -------------------------------------------------------------------------------- /repository/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | .project 3 | -------------------------------------------------------------------------------- /repository/category.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /repository/deploy-settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | jboss-snapshots-repository 5 | ${env.DEPLOY_USER} 6 | ${env.DEPLOY_PASS} 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /repository/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | repository 4 | 5 | org.eclipse.lsp4e 6 | parent 7 | 0.13.1-SNAPSHOT 8 | 9 | eclipse-repository 10 | 11 | -------------------------------------------------------------------------------- /target-platforms/target-platform-latest/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | target-platform-latest 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /target-platforms/target-platform-latest/target-platform-latest.target: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | com.vegardit.no-npe 34 | no-npe-eea-all 35 | 1.3.5 36 | jar 37 | 38 | 39 | 40 | 41 | 42 | --------------------------------------------------------------------------------