1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 06:02:11 +02:00
Commit graph

34944 commits

Author SHA1 Message Date
Alexander Fedorov
0bf22a2103 Bug 558664 - cquery and clangd: registered each LS from its own bundle
Part 13:
Add about.html and align headers.

Change-Id: I6c3fdfdbea65fbcc1e60a653ff6619afee916212
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-20 13:43:59 -04:00
Alexander Fedorov
df0e1d62b1 Bug 558664 - cquery and clangd: registered each LS from its own bundle
Part 12:
Extract cquery tests to org.eclipse.cdt.lsp.cquery.tests bundle.

Change-Id: I188fc5a0b06bccfeb0884c054c0d972226857b78
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-20 13:43:59 -04:00
Alexander Fedorov
fa03b9225b Bug 558664 - cquery and clangd: registered each LS from its own bundle
Part 11:
Move cquery code to org.eclipse.cdt.lsp.cquery bundle.

Change-Id: I079f08c1aa1c177abdc291402931f7547ab325bf
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-20 13:43:59 -04:00
Alexander Fedorov
b8427cb54a Bug 558664 - cquery and clangd: registered each LS from its own bundle
Part 10:
Move clangd code to org.eclipse.cdt.lsp.clangd bundle.

Change-Id: Ib2938ea34a4996a535658decc61a725f4626c649
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-20 13:43:59 -04:00
Alexander Fedorov
1fb6efa9c3 Bug 558664 - cquery and clangd: registered each LS from its own bundle
Part 9:
Add LSP clangd bundle.

Change-Id: I9274f56e7e2692f58b2a469007b1853b3e9c1d48
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-20 13:43:59 -04:00
Alexander Fedorov
8da8e068a5 Bug 558664 - Cquery integration should be extracted from LSP Core
Part 8:
Add LSP CQuery bundle.

Change-Id: Ie728716916b4d4ee854faec50925957f7d9436b5
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-20 13:43:59 -04:00
Alexander Fedorov
58e1b69c80 Bug 558664 - Cquery integration should be extracted from LSP Core
Part 7:
Extract CQuery protocol extension to its package and declare it as a
LanguageProtocolExtension component.
Remove custom "clientImpl" from LSP extension point, as we can use
standard one.
Declare DelegatingLauncherBuilder to collect and register language
extensions for the preferred language server.

Change-Id: I88be0456bbb53d24a6a0df2578c145649268b028
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-20 13:43:59 -04:00
Alexander Fedorov
3efcecf379 Bug 558664 - Cquery integration should be extracted from LSP Core
Part 6:
Declare SupportedProtocolExtensions interface to access contributed
LanguageProtocolExtension for a given language server.
Extract ResolvePreferredServer class.
Add ContributedProtocolExtensions OSGi component with tests.

Change-Id: Iecb1fff5a29a559e3c9d8703cc7d8fa71bb18042
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-20 13:43:59 -04:00
Alexander Fedorov
c609416622 Bug 558664 - Cquery integration should be extracted from LSP Core
Part 5:
Extract CQuery protocol methods to separate types.

Change-Id: I14f48ff4f374bd257adec67708bf58150993db21
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-20 13:43:59 -04:00
Alexander Fedorov
8abfaab458 Bug 558664 - Cquery integration should be extracted from LSP Core
Part 4:
Switch C/C++ LSP preferences to LanguageServerConfiguration and remove
constants with server identifiers. Align i18n accordingly.

Change-Id: I4dcd9ea57a2c4577bb6763bb859afbd339eb66e0
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-20 13:43:59 -04:00
Alexander Fedorov
3705069ef2 Bug 558664 - Cquery integration should be extracted from LSP Core
Part 3:
Convert ContributedLanguageServers to OSGi component and switch usages
to its interface.
Convert LanguageServerConfiguration implementations to OSGi components.

Change-Id: Ic22fa26a7abfd40a959ae0189a63b9a04d1ac4e0
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-20 13:43:59 -04:00
Alexander Fedorov
05ae2a8185 Bug 558664 - Cquery integration should be extracted from LSP Core
Part 2:
Introduce SupportedLanguageServers interface and remove knowledge about
specific language server from CPPStreamConnectionProvider. Replace
ICPPLanguageServer with LanguageServerConfiguration.
Move Clangd and Cquery server configurations to its packages.

Change-Id: I825c39bc6f8004616e639fda28660d3c98d08057
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-20 13:43:59 -04:00
Alexander Fedorov
afaa593d34 Bug 558664 - Cquery integration should be extracted from LSP Core
Part 1: rework "$cquery/progress" notification handling to be reusable

Change-Id: I6995594e51289e7f8a516ffc2cc2ec8bda88f919
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-20 13:43:59 -04:00
Moritz 'Morty' Strübe
240ca9085c Bug 538147 Fix mounting folders using windows
Removing unnecessary code fixes things, as paths are corectly handled
in the docker code.

Change-Id: If8b6b8877d5664c6692f58b0646cd0a93857a379
2020-08-20 13:13:29 +02:00
Jonah Graham
a588063b23 Bug 521515: Automatically check .so, .dll, .exe files for valid deps
Because we build cross platform, we want to make sure no unexpected
dependencies are introduced on newer or non-universal libraries
in the native code.

Change-Id: Ib8ffeb5f374bcd04514c31dca9d8297fed70343a
2020-08-18 21:43:21 -04:00
Torbjörn Svensson
5a3d2e744b Bug 521515: Also build pty.dll if host is Windows
Change-Id: Idb991b8c641a6fd7a38ef32cce04c63f15f8f57d
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-18 20:16:49 -04:00
jantje
2a62d58621 Bug 564123 Treat environment and build variable case sensitively
Remove all equalIgnoreCase and equal with uppercasing for environment
variables

Change-Id: Ic15974b5fb62413c7b1826ced544ff6d4a8eba2f
Signed-off-by: jantje <eclipse@baeyens.it>
2020-08-18 18:11:48 -04:00
Torbjörn Svensson
09582630d7 Bug 521515: Do not log every failed access attempt
The Windows registry can be checked for keys that may not exist.
In order to avoid logging an exception that the entry is missing when
it's not critical that the entry do exist, the method should just return
null and let the caller handle if it's critical or not that the entry
exists. To easily debug situations where the entry is supposed to always
exist, the trace symbol
"org.eclipse.cdt.core.native/debug/win32/registry" can be set to "true"
and the exceptions will be logged in any case.

Change-Id: I6603cbe363ebecd357fa44c41fb1a26c6345dd70
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-18 14:52:26 -04:00
Jonah Graham
a708a1dcc9 Bug 564123 Remove deprecated PathUtil that has a replacement
Change-Id: Ie2fd4ed201a2bc0c490df9b0deb43cb6d53b1876
2020-08-18 12:33:13 -04:00
Jonah Graham
ef79d15071 Bug 564123 Remove long commented out and dead test code
Change-Id: I0022463409db4de701b3ad18e1309f894d499e2a
2020-08-18 12:26:40 -04:00
Jonah Graham
8c1be591ff Bug 521515: Build pty.dll in docker (fixup)
Fixes for items identified by Torbjörn in my changes to commit
2d03236339

Change-Id: I51f289f731062b4a43bb041d25cd08467014151e
2020-08-18 08:20:12 -04:00
Alexander Fedorov
786ae3ce2b Bug 566093 - CDT LSP: null-free functions to retrieve URL from IDocument
make ResolveDocumentUri final

Change-Id: I06169d98f6af3b49595e4e8f6308c6aad790eaf7
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-18 14:46:44 +03:00
Alexander Fedorov
f555015183 Bug 566093 - CDT LSP: null-free functions to retrieve URL from IDocument
Remove Server2ClientProtocolExtension::getUri

Change-Id: Iee7e4808e40160e456f3db85c4dc98d04632a92a
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-18 10:03:58 +03:00
Torbjörn Svensson
2d03236339 Bug 521515: Build pty.dll in docker
Change-Id: I370327489b6c18ac6ba9f36a8da9e94b078ffe1e
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-17 21:42:25 -04:00
Alexander Fedorov
baddefe9cf Bug 566093 - CDT LSP: null-free functions to retrieve URL from IDocument
Introduced org.eclipse.cdt.lsp.internal.text.ResolveDocumentUri
implements
Function<IDocument, Optional<URI>>
Reworked usages of Server2ClientProtocolExtension#getUri(IDocument)

Change-Id: I7ccbe4e1c2016fdd3ef618e4fbdf80f3a67c8ac5
Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-17 13:35:37 -04:00
Martin Weber
60e32477d0 Remove unused file.
Unused since bug 559674: Integrate new indexer support into CDT build

Change-Id: Ifd4878f944eff6f12e3ab2df399c619abfa47f59
Signed-off-by: Martin Weber <fifteenknots505@gmail.com>
2020-08-16 16:09:59 -04:00
Alexander Fedorov
7cccb6ba3a Revert "Bug 566093 - CDT LSP: null-free functions to retrieve URL from IDocument"
This reverts commit 46a799d96d.

Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-15 12:40:17 +03:00
Alexander Fedorov
46a799d96d Bug 566093 - CDT LSP: null-free functions to retrieve URL from IDocument
Introduced org.eclipse.cdt.lsp.internal.text.DocumentUri implements
Function<IDocument, Optional<URI>>
Reworked usages of Server2ClientProtocolExtension#getUri(IDocument)

Signed-off-by: Alexander Fedorov <alexander.fedorov@arsysop.ru>
2020-08-15 11:54:52 +03:00
Martin Weber
9e303185f9 Bug 564002: Restore the default pattern of the surefire-plugin
Sets the pattern to the default of upcoming tycho 2.0 in advance.

Signed-off-by: Martin Weber <fifteenknots505@gmail.com>
Change-Id: I31b3fc733d0cb888fbf6f566995ce2043f6cd621
2020-08-13 14:18:47 -04:00
Torbjörn Svensson
a025f75771 Bug 521515: Generate JNI header files as part of build
Also generate JNI header for serial component. This component does not
really need it since the implementation is in one file only, but this
would at least throw an error if the java part changes and the native
part is not updated accordingly.

Change-Id: Id598410c322580bdda37c905ed08627390c913ba
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-13 10:13:52 +02:00
Jonah Graham
7120731766 Bug 521515: Generate JNI header files as part of build
Change-Id: Ia92da44f964e1934b2c32d2536f3ec27c03d5d59
2020-08-12 21:30:42 -04:00
Jonah Graham
ba24afc3a4 Bug 521515: Save the log file all the time when building natives
Change-Id: I11b149d94f837dcb9537682a55551add289f8924
2020-08-12 21:30:42 -04:00
Torbjörn Svensson
49dc726dd1 Bug 521515: Use channel object for native stream access
On Linux and mac, a simple int will do for accessing streams (file
descriptor).
On Windows, a HANDLE is used. This is in reality a pointer and on 64
bit JVM, the pointer will not fit in an int. To not force a change to
the API everytime a different platform has a different requirement
for accessing streams, use a common interface and specific classes
that is known by the native part. The java part of the function
block should just pass the object back to the native code when
needing to reference an open stream.

Change-Id: Ibc3ff5c85735dac6a0ce8e9a1f25b839d7e9aab9
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-12 11:48:35 -04:00
Dominic Scharfe
0d50385e63 Bug 565771: Allow to extend GdbConnectCommand PID prompting mechanism
- partially refactor connect method to connectToProcesses
- rename variables to match existing ones from other methods
(attachToProcesses and the PromptForPidJob constructor)
- change visibility for attachToProcesses from private -> protected

Change-Id: I62de9e1303895faac61fec011a8cce0d59d81f71
Signed-off-by: Dominic Scharfe <dominic.scharfe@coseda-tech.com>
2020-08-12 11:45:39 -04:00
Torbjörn Svensson
0ede7c7a60 Bug 534105: Only files are allowed to be executed
When searching the PATH environment variable, only accept resources of
type "file" and that are executable. Any directories on the PATH is
silently ignored by shells and so should also CDT do.

Change-Id: Ia7cfd1b0b61d59602994528f0fb2af7fee93d946
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-12 10:47:03 -04:00
Jonah Graham
f0235bae94 Bug 565628: Fix typo in variable name
Change-Id: I62a470e6ebe3b3e8369aad5861bab7dc1d5dd6f4
2020-08-12 10:01:00 -04:00
Jonah Graham
e2dd4868ff [releng] Add instructions for updating org.eclipse.cdt.core.win32.x86_64's dlls
(BTW We need a better solution for this!)

Change-Id: Ic163e2504ff62cabc6951de2ec5606646c460937
2020-08-12 09:55:42 -04:00
Jonah Graham
ee0e931b42 Bug 565628: Handle formatting/indentation of XML files with CDT code only
The javax.xml.transform.Transformer as used in CDT did not fully
indent, despite INDENT=yes being set (See Bug 286751).

However in Java 11, INDENT=yes started doing "more", so to maintain
compatibility with how .cproject and others are formatted, turn
off INDENT=yes and rely solely on XmlUtil.prettyFormat and the
related workarounds in xmlutil.

Change-Id: Icec04cfd3f9f1290593cff8b15b398b41c9d932a
2020-08-11 18:20:09 -04:00
Jonah Graham
6f3cb8014b Bug 565628: Fix spelling of Indent in variable names
Change-Id: Ifb9124927a7c1afecede6e8bcd75ac8c09526422
2020-08-11 18:19:53 -04:00
Jonah Graham
149ccaffcc Bug 565836: Add linux aarch64 for natives
Note: the Windows dll is not actually modified, apart from the embedded
date stamp to match the date of the jni/ modification

Also-by: Liviu Ionescu <ilg@livius.net>
Change-Id: Ice3d5e7ae5999a0e4d1866e76e515a91e30e9f11
2020-08-11 17:17:34 -04:00
Torbjörn Svensson
00a52086c9 Bug 521515: Adopt native build support on jenkins
Change-Id: I6aee7a7c94f93375d3a2ddb0171602a27a6873e7
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-06 20:55:42 -04:00
Torbjörn Svensson
69acfe4819 Bug 521515: Align directory name of native source code
The native directory can contain both libraries and utilities. In
Gerrit https://git.eclipse.org/r/c/cdt/org.eclipse.cdt/+/165270,
there is a utility, so the directory name "jni", or even "library" does
not work. In order to support both utilities and libraries, the
suggested name of the directory is "native_src" and thus, this commit
syncs that change in o.e.c.native.serial.

Change-Id: Iafa9ce9ae1dca7ef563ab397e8b3eb0b8642372d
Signed-off-by: Torbjörn Svensson <azoff@svenskalinuxforeningen.se>
2020-08-06 20:54:52 -04:00
Jonah Graham
2bd07a89ca Bug 559674: Include only "primary" cmake.is support by default
The vendor specific support files need to be installed separately.
Includes changing the bundles display names to match the CMake main bundle
so that in the install wizard it is clear(er) what they work with.

Change-Id: I12ca155228e906c6c38fe37e37e8ce08d05a2452
2020-08-04 16:23:03 -04:00
Jonah Graham
279fc6a8b2 Bug 559674: Include CMake IS in CMake feature
This is one way to publish the cmake.is plug-ins. It may be that
additional features are desired as this implementation is all of cmake
support or non of it.

Change-Id: Ie945d2ce94b5ac34c6c238ed7bfbdc3ff336e538
2020-08-04 12:51:02 -04:00
Marc-Andre Laperle
4ebaaf7b25 Bug 565457 - CDB settings provider/parser's automatic exclusion of files is very slow
Implement a file exclusion algorithm that favors excluding whole folders when
possible.

The way it works is we gather exclusion information of each folder as we visit
each children. When "leaving" the folder, we can act on whether or not it can
be considered for exclusion as a whole or instead individually exclude a subset
of its children.

Using LLVM code base as a test:
Before: 613 sec
After: 2.4 sec

Change-Id: Ib882a72cae157e3db6b6c94a1a09cb6f05b66bc4
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-08-03 21:46:22 -04:00
Jonah Graham
6d4f20edd6 Bug 540737: Add 8 and 24-bit color support to terminal
Change-Id: Iab3b648fb3bfa8f43f333371bd118e90a3a182f2
2020-08-03 17:28:59 -04:00
Jonah Graham
d6818fbb03 Bug 549697: Define standard terminal colors with Eclipse preferences
New types TerminalColor and TerminalStyle replace StyleColor and Style
to separate the meta information about styles and colors from the
user currently selected colors.

The StyleMap maps the TerminalColor/Style to the concrete fonts and
colors used in the display.

Colors are now configurable via the terminal preference page using
the new TerminalColorsFieldEditor.

All preferences are now passed in to the VT100 control so that
different terminal consumers can have different preferences and
styles.

Remove dark theme contribution. The colors of the terminal are
now inherited from the editor settings (using SystemDefaultColors)
which come from the theme. If we were to invert colors
too when in Dark theme then the colors actually end up light
background.

Change-Id: I2cf5427ac0be9a189a7f0d3565cfc97ceedb8749
2020-08-03 17:28:59 -04:00
Jonah Graham
c6f2eb5588 [releng] Update self-referenced CDT version in target
Change-Id: Ibf8f2f01d97d1d8bf8fa09483170e70372b99d26
2020-08-03 14:56:33 -04:00
Jonah Graham
285c75837e [releng] Update to Eclipse platform 4.17 M2 contribution
Change-Id: I394fd614400cae4b4ee3efe33cedc4dea67fb7f5
2020-08-03 13:03:43 -04:00
Marc-Andre Laperle
9e7b5beaa9 Bug 565553 - Improve performance of build command parsers with large number of files
Cache results of various path resolution algorithms.

Resolving paths is particularly slow while creating entries, see
AbstractLanguageSettingsOutputScanner.createResolvedPathEntry.

There are three main callees within that method that this patch addresses with
a caching approach:

* findContainerForLocationURI: First, this finds containers for a given URI in
the workspace using Eclipse resources API. Then a single container is
selected based on a preferred project. This can done repeatedly for include
paths, which are often similar for source files in a given project or source
folder. This first step is the expensive one and it only depends on one
argument (the URI) and a simple IResource[] return type, so the cache here is
done for this operation. Then the post-filtering is kept as is.

* findFileForLocationURI: Similar to the container case but for files. A
typical projet has much less file paths than folder paths in its options. One
more common option using file paths is -include. The same approach is applied
here as the previous point because there are performance gains but they are
smaller if you consider typical projet setup.

* findBestFitInWorkspace: When a path cannot be found, this makes an attempt to
find the parsed path relative to every folder of the workspace, by starting
first with the preferred project, then its referenced projects and then the
rest. Caching the result of findBestFitInWorkspace itself is too cumbersome
because the result depends on 3 variables (currentProject,
currentCfgDescription and parsedName) which would make a complex cache key.
Instead, caching the result of findPathInFolder at the project level is
sufficient, with little to no performance difference.

In all three cases, the class LRUCache is used in order to limit memory
consumption of the cache. A limit of 100 elements for each cache was chosen
based on experimentation with a few projects like LLVM and projets several
times bigger. A limit higher than necessary for small projects does not incur a
noticeable overhead for small projects and a limit too small for very large
projects merely diminishes the performance gains.

Using LLVM code base as a test, the time to parse options for all files:
Before: 68395ms, after: 5599ms

Change-Id: Ib997e9373087950f9ae6d93bbb1a5f265431c6bc
Signed-off-by: Marc-Andre Laperle <malaperle@gmail.com>
2020-08-03 12:47:18 -04:00