Commit Graph
58 Commits
Author SHA1 Message Date
8833e5e873 fix(csharp): skip .csproj files excluded by the project's ignore settings (#2074)
CSharpLanguageServer._open_solution_and_projects scanned the whole
repository root and opened every .csproj it found, without consulting
the project's ignore settings.

On repositories that vendor third-party or sample C# projects this
opens projects the language server cannot restore. The cost is paid on
every server start, and the resulting restore failures bury the
diagnostics of the projects the user actually works on. Measured on an
Unreal Engine source tree: 245 projects opened, 53 of them under
Engine/Source/ThirdParty, which Roslyn cannot build; each restart
emitted thousands of NuGet advisory lines and ended in
`The "Csc" task could not be initialized`.

SolidLanguageServer.is_ignored_path already implements exactly this
check, and CSharpLanguageServer already overrides is_ignored_dirname,
so the ignore settings were being honoured everywhere except here.
This applies the existing check at project discovery.

ignore_unsupported_files=False is required because a .csproj is not
itself a C# source file, and would otherwise be excluded on file type
rather than by the ignore patterns.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Dr. Dominik Jain <dominik.jain@oraios-ai.de>
2026-09-21 14:39:23 +02:00
Amir Fathi 941f4ded18 fix(csharp): stop tuple-typed properties losing their name to the method branch (#1967)
* fix(csharp): stop tuple-typed properties losing their name to the method branch

_extract_base_name_and_type split Roslyn's "Name : Type" property names by
checking for a literal '(' anywhere in the raw string. A C# tuple type is
written with parentheses ("(int X, string Y)"), so a tuple-typed property
tripped that guard and fell into the method branch instead, which kept the
trailing " :" as part of the reported name (e.g. "Position :"). Since
find_symbol defaults to exact name-path matching, such a property becomes
unfindable by its real name.

The guard now only checks for '(' in the identifier segment before the
first " : ", not the whole string, so a parenthesis inside the type
annotation no longer affects branch selection.

* fix(csharp): bump the high-level symbol cache fingerprint

_normalize_symbol_name's output changed in this PR, and
_document_symbols_cache_fingerprint gates the cache that stores its
result; leaving the version at 1 would keep serving the old, corrupted
names to anyone with an existing on-disk cache.
2026-09-21 12:14:38 +02:00
Dominik Jain 6707cd9b7e Introduce component-based licensing: Serena GPL-3.0-or-later, SolidLSP MIT
The repository is licensed per component. SolidLSP (src/solidlsp,
test/solidlsp, test/resources) remains MIT-licensed and independently
reusable; the Serena application (src/serena, src/interprompt, scripts,
test/serena, docs) is licensed under GPL-3.0-or-later starting with the v2
licensing transition. The change is not retroactive: all releases and
commits up to v1.7.0 / 74c38a65 (tag mit-final) remain available under MIT.

Since MIT is GPL-compatible, a distribution combining both (such as the
serena-agent package) is as a whole subject to GPL-3.0-or-later, while the
SolidLSP files themselves stay MIT and can be extracted and used separately
under MIT terms. The distribution metadata therefore declares
GPL-3.0-or-later, with both license texts shipped alongside it.

Serena originally began under the GPL (v2) and was switched to MIT in
May 2025 following community requests. We consider that change a mistake;
the substantial changes in v2 make this the appropriate time to revert it.
We want the best version of Serena to remain free.

Changes:
* LICENSE is now the licensing overview; canonical license texts live in
  LICENSES/ (MIT.txt is the previous LICENSE verbatim, GPL-3.0-or-later.txt
  is the unmodified FSF text)
* pyproject.toml declares the PEP 639 license expression
  "GPL-3.0-or-later" and bundles LICENSE and LICENSES/* as license files;
  the deprecated MIT classifier is dropped and flake.nix declares gpl3Plus;
  README has per-component license badges and a License section
* SPDX-License-Identifier headers in all Python sources under src/ and
  scripts/, added by the new idempotent scripts/add_spdx_headers.py, which
  gen_prompt_factory.py also uses to keep the header on the generated
  module; existing third-party notices are preserved
* CLA.md: Contributor License Agreement (contributor retains copyright;
  grants a perpetual, irrevocable license including relicensing under any
  terms, incl. proprietary/commercial; patent grant; authority
  representations), to be enforced repository-wide via cla-assistant.io
* CONTRIBUTING.md, PR template and a new docs page explain the licensing
  boundary and the CLA workflow
2026-09-14 21:33:18 +02:00
Dominik JainandClaude Opus 4.8 1c12156901 SolidLSP: Apply InitializeParamsBuilder across all remaining language servers
Convert every remaining SolidLanguageServer subclass from the old
_get_initialize_params method to the new _create_base_initialize_params
override, so common LSP initialize keys (processId, rootPath, rootUri,
clientInfo, workspaceFolders) are provided centrally by the
InitializeParamsBuilder rather than by each server.

- Drop the per-server processId/rootPath/rootUri/workspaceFolders and all
  clientInfo entries (including the VS Code spoofs in rust_analyzer and
  sourcekit); these are now set centrally.
- Preserve nested capabilities.workspace.workspaceFolders flags and any
  server-specific initializationOptions.workspaceFolders (e.g. kotlin,
  eclipse_jdtls).
- omnisharp keeps loading its JSON template but no longer sets the
  centrally-managed keys.
- Update _start_server call sites to self._create_initialize_params() and
  drop now-unnecessary cast()/type: ignore wrappers.

angular, svelte and vue are intentionally left as-is: they already override
_create_base_initialize_params for their TypeScript companion server, and
their remaining _get_initialize_params drives a separate language server
process.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-03 01:05:40 +02:00
Michael Panchenko 7333a0c868 Replace mypy by ty (#1619) 2026-06-29 12:26:07 +02:00
Lauritz-Configo 8e7c8feb84 Fix Windows C# startup and Roslyn install 2026-06-27 19:29:43 +02:00
Michael Panchenko df0f476614 LS: mark LS that support implementation request 2026-04-28 12:17:18 +02:00
Dominik Jain a26d3337a7 Improve symbol typing
* Clearly differentiate between raw and high-level symbol types
* Remove the catch-all type GenericDocumentSymbol
* Introduce RawDocumentSymbol alias for the raw LS types
2026-03-29 17:54:05 +02:00
Dominik Jain 97a6845c78 SolidLanguageServer: Support name normalisation in request_document_symbols via new method
* Introduce method _normalize_symbol_name to support name transformation
* Apply in CSharpLanguageServer, fixing old override of request_document_symbols
  not accounting for overload handling (invalidating high-level cache accordingly)
* Apply in ALLanguageServer
2026-03-29 17:37:57 +02:00
Michael Panchenko f00a992e5d Security enhancement: pinned all runtime deps, verify checksums
Extended documentation of ls_specific_settings and of our security approach
2026-03-27 13:00:09 +01:00
Dominik Jain 9800d4e98b Introduce DotNETUtil
* Apply in FSharpLanguageServer and CSharpLanguageServer
* CSharpLanguageServer: Disabled auto-install of .NET (does not work reliably)
  and remove corresponding test
* Remove TestFSharpLanguageServerSetup
2026-03-02 17:47:32 +01:00
Michael Panchenko 229ce04312 Fix: the request_info for a batch of symbols was actually never optimized 2026-02-24 17:29:31 +01:00
joachim.arting 88cd3c27a2 feat(csharp): add .slnx solution file support 2026-02-23 09:08:18 +01:00
Dominik Jain 3791c1b050 CSharpLanguageServer: Make clear that pwsh is required 2026-02-19 17:23:46 +01:00
Dominik Jain 256cb61416 DependencyProviders: Allow only lists for commands to ensure robustness 2026-02-13 03:20:13 +01:00
Tom Longhurst b97bc5ac51 Warn about deprecated DotNetRuntime override
Filter out DotNetRuntime overrides from runtime_dependencies and
log a warning informing users that .NET is now installed via
Microsoft's official scripts.
2026-02-02 23:02:47 +00:00
Tom Longhurst 3627f61977 Address PR review: use iter_symbols() and make hover tests assertive
- Replace get_all_symbols_and_roots() with iter_symbols() to avoid
  redundant tuple unpacking
- Make hover tests assert that hover_info is not None instead of
  defensive conditionals
2026-02-02 22:28:56 +00:00
Tom Longhurst 973724c258 Add hover injection for C# type annotations
Following ALLanguageServer pattern, inject cached original symbol names
(with type annotations) into hover responses. This ensures type information
is available via hover operation as per SolidLSP convention.

- Override request_hover() to prepend original names to hover content
- Add comprehensive hover test verifying both property and method hovers
- Test covers Name property and IsAdult method

Addresses reviewer feedback about delivering type info via hover.
Test passes.
2026-02-02 14:45:06 +00:00
Tom Longhurst 611acebe67 Normalize Roslyn symbol names and populate LSP detail field
Roslyn 5.5.0 returns symbol names with type annotations:
- Properties: "Name : string" instead of just "Name"
- Methods: "Add(int, int) : int" instead of just "Add"

This broke Serena's overload detection system which expects clean
base names with overload_idx for duplicates.

Solution:
- Override request_document_symbols() in CSharpLanguageServer
- Normalize symbol names to base form ("Name", "Add")
- Cache original names at (file, line, char) for rich info display
- Populate LSP spec's 'detail' field with type/signature info
- Process children symbols recursively

Follows AL Language Server pattern. All 24 C# tests pass.
2026-02-02 12:47:12 +00:00
Tom Longhurst b5f8cd55dd Update CSharpLanguageServer docstring to reflect new NuGet.org and install script behavior
- Remove outdated DotNetRuntime override example
- Add CSharpLanguageServer override example
- Document .NET 10+ requirement and automatic installation
- Clarify that install scripts are now used for runtime

Addresses code review feedback about outdated documentation.
2026-02-02 10:40:16 +00:00
Tom Longhurst af0075c3e0 Use official .NET install scripts instead of manual downloads
Replace manual .NET runtime downloads with Microsoft's official dotnet-install
scripts for better maintainability and automatic platform detection.

Changes:
- Remove 6 DotNetRuntime RuntimeDependency entries (42 lines removed)
- Replace _ensure_dotnet_runtime_from_config with _install_dotnet_with_script
- Use bash script (dotnet-install.sh) for Linux/macOS
- Use PowerShell script (dotnet-install.ps1) for Windows
- Update version check from .NET 9 to .NET 10+ (supports 10.x, 11.x, etc.)
- Add comprehensive tests for install script behavior

Benefits:
- Simpler codebase (~80 lines of manual download code → ~60 lines of script invocation)
- Automatic platform/architecture detection by Microsoft scripts
- Built-in checksum verification and dependency handling
- Official Microsoft-maintained approach
- Easier version updates (just change version string)
- Better compatibility with .NET 10 (required by roslyn-language-server packages)

The language server packages from NuGet.org remain unchanged - this only
affects how the .NET runtime is installed to execute the language server.
2026-02-02 10:32:53 +00:00
Tom Longhurst b238e1d0ce Switch C# language server from Azure NuGet feed to official NuGet.org
Replace Microsoft.CodeAnalysis.LanguageServer packages from Azure DevOps
feed with official roslyn-language-server packages from NuGet.org.

Changes:
- Update package names to roslyn-language-server.* (from Microsoft.CodeAnalysis.LanguageServer.*)
- Update version from 5.0.0-1.25329.6 to 5.5.0-2.26078.4
- Add direct URLs pointing to NuGet.org for each platform variant
- Update extract paths from content/LanguageServer/<platform> to tools/net10.0/<platform>
- Simplify download logic by removing Azure feed service index lookup
- Replace _download_nuget_package_direct with simpler _download_nuget_package
- Add tests to verify NuGet.org download behavior

Benefits:
- More reliable package source (official NuGet.org vs Azure DevOps feed)
- Newer version with latest Roslyn improvements
- Simpler codebase (removed ~60 lines of Azure-specific logic)
- Better error messages with explicit URLs
2026-02-02 10:21:43 +00:00
Dominik Jain 9d9e83770e Remove event completions_available and other superfluous events in LS implementations 2026-02-01 21:02:21 +01:00
Dominik Jain 18ab2cea9a Improve docstring explaining overrides in ls_specific_settings [skip ci] 2026-01-19 23:21:07 +01:00
Dominik Jain b33a4085c2 CSharpLanguageServer: Refactored to use DependencyProvider 2026-01-15 18:55:15 +01:00
Dominik Jain 16792389d7 Add missing DotNetRuntime dependency for win-arm64
Fixes #921
2026-01-13 17:05:15 +01:00
Dominik Jain b724eccde6 CSharpLanguageServer: Wait for indexing to complete
resolving issues pertaining to retrievals not working correctly initially

Fixes #814
2025-12-08 18:27:23 +01:00
Dominik Jain fd8bd8d064 Fix log statement 2025-12-08 18:24:53 +01:00
Dominik Jain 82d495b2a6 Remove LanguageServerLogger
Resolves #745
2025-11-20 21:33:37 +01:00
Dominik Jain 2338d33356 Fix mypy issues 2025-11-19 23:45:11 +01:00
Dominik Jain 11cb8f2811 Merge branch 'main' into mypy_on_solidlsp
Conflicts:
	src/solidlsp/language_servers/elixir_tools/elixir_tools.py
	src/solidlsp/language_servers/gopls.py
	src/solidlsp/language_servers/terraform_ls.py
	src/solidlsp/ls.py
	src/solidlsp/ls_handler.py
2025-11-19 22:10:16 +01:00
Dominik Jain 064224d6ae Refactor retrieval of LS-specific settings, adding abstraction
and ensuring that all relevant retrievals are logged
2025-11-10 20:08:58 +01:00
Dominik Jain 0a40f580dd Improve handling of custom LS-specific settings 2025-11-10 18:50:10 +01:00
Dominik Jain f5f1f267de Merge branch 'main' into mypy_on_solidlsp
Conflicts:
	src/solidlsp/language_servers/common.py
	src/solidlsp/language_servers/csharp_language_server.py
	src/solidlsp/language_servers/dart_language_server.py
	src/solidlsp/language_servers/intelephense.py
	src/solidlsp/language_servers/solargraph.py
	src/solidlsp/language_servers/typescript_language_server.py
	src/solidlsp/language_servers/vts_language_server.py
	src/solidlsp/ls.py
	src/solidlsp/ls_handler.py
2025-10-23 20:54:42 +02:00
MischaPanch 96aec3f885 Moved logic of handling updates to csharp dependencies to RuntimeDependencyCollection
Removed the RuntimeDependencyLoader
2025-09-19 17:59:10 +02:00
maksim.randClaude 3df6ae9f77 feat(csharp-ls): allow runtime dependency overrides via ls_specific_settings
Add configurable runtime dependency system for language servers:
- New RuntimeDependencyLoader for loading platform-specific dependencies
- Extended SerenaConfig with language_server_dependencies field
- Updated configuration template with ARM64 examples
- Modified CSharpLanguageServer to use dependency loader

This enables adding platform support (like ARM64) via YAML configuration
without requiring code changes and PRs.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-18 15:54:43 +03:00
Michael Panchenko 5d33a301f3 Allow passing LS implementation specific options. (#524)
* Allow passing LS implementation specific options. Made use of it in csharp and intelephense LS
* Bidirectional mapping from Language to the corresponding LS implementation Use this as key for ls_specifics.

Fix to swift installation in CI authored-by: maksim.r <avalab>
2025-09-13 00:36:21 +02:00
MischaPanch 0699c378c1 Bump wait_time_for_cross_file_referencing in csharp LS 2025-08-26 14:23:57 +02:00
MischaPanch e6ae39ab1b Fixed path in test 2025-08-15 13:28:32 +02:00
MischaPanch d4dedd5d84 Improve waiting logic for cross-file references to be ready
Now waiting only once instead of on each request, hopefully that's enough
2025-08-15 13:10:46 +02:00
Michael Panchenko 7df16d21e5 Bump wait time for references in csharp_language_server.py 2025-08-14 21:51:22 +02:00
MischaPanch c82fab97c1 CSharp: added waiting for request_referencing and test for cross-file references 2025-08-14 12:01:58 +02:00
MischaPanch b8daef9167 Formatting 2025-08-08 14:16:24 +02:00
MischaPanch ab4355e27b C# - added handler for _roslyn_projectNeedsRestore, fixes #303 2025-08-08 14:07:27 +02:00
Dominik Jain 0f49429002 Formatting 2025-08-07 12:56:51 +02:00
johngambleubind b09cbc089d Fix #384: Use safe zip extraction for C# dependencies (#418) 2025-08-07 10:52:01 +02:00
MischaPanch a5db2f4616 Permissions: set sane mode (755) instead of just executable for downloaded binaries 2025-08-03 15:53:43 +02:00
Dominik Jain 8e8f304377 Merge branch 'main' into mypy_on_solidlsp
Conflicts:
	src/solidlsp/ls.py
	src/solidlsp/ls_handler.py
	src/solidlsp/ls_request.py
2025-07-27 23:48:47 +02:00
Dominik Jain 66b17cd9e2 Merge branch 'fix-ls-interaction' 2025-07-27 23:10:56 +02:00
Dominik Jain bb0e944b6d Rename LanguageServerException -> SolidLSPException
(making clear that the exception originates from the proxy framework of SolidLSP)
2025-07-27 23:09:17 +02:00