Commit Graph
183 Commits
Author SHA1 Message Date
Jaen dcaf9ec992 Add test for escaped negation pattern parsing
Test demonstrates the fix for escaped character handling order:
- Escaped negation patterns are treated as literals, not negations
- Real negation patterns properly override ignore rules
2025-07-24 23:43:21 +03:00
Jaen ba8f07d836 Fix gitignore anchored pattern logic and update test
- Use correct anchoring logic: only patterns starting with '/' are anchored
- Fix test expectation for negation patterns to match Git behavior
- Apply code formatting
2025-07-24 23:35:54 +03:00
Dominik JainandDominik Jain 99024b8cc5 Add abstraction RegisteredProject, which serves as a factory for Project
(allowing projects to be lazy-loaded)
2025-07-20 19:24:24 +02:00
Michael PanchenkoandMichael Panchenko 2772132b6a Tests: raised loglevel to error 2025-07-14 11:41:41 +02:00
Dominik JainandDominik Jain 6a8a1810ed Rename variables: symbol_manager -> symbol_retriever 2025-07-10 23:16:37 +02:00
Dominik JainandDominik Jain 8c36377dc2 Move classes CodeDiff and LineChange to test_symbol_editing 2025-07-10 01:22:37 +02:00
Dominik JainandDominik Jain 65b20c4276 Refactoring
* Remove SymbolManager instance from agent; instead, create it ad hoc
  * Rename SymbolManager -> LanguageServerSymbolRetriever
  * Rename Symbol -> LanguageServerSymbol
  * Rename AbstractSymbol -> Symbol
  * Rename SymbolLocation -> LanguageServerSymbolLocation
  * Rename ReferenceInSymbol -> ReferenceInLanguageServerSymbol
2025-07-10 01:22:36 +02:00
Dominik JainandDominik Jain 17c0b2a949 Fix method reference 2025-07-10 00:41:06 +02:00
Dominik JainandDominik Jain ce9a4ef195 Add retrieve_content_around_line to Project (keeping LS version, too, for the time being),
such that FindReferencingSymbolsTool is now also implemented without a direct reference
to the language server

All references to Component.language_server have been removed
2025-07-09 23:38:20 +02:00
Dominik JainandDominik Jain 3d4d71206f Update Elixir tests 2025-07-09 23:05:36 +02:00
Dominik JainandDominik Jain 528d805aa4 Merge remote-tracking branch 'origin/main' into jetbrains 2025-07-09 23:00:51 +02:00
Dominik JainandDominik Jain 75436727d0 Refactoring: Remove names of methods moved to Project:
* search_files_for_pattern -> search_source_files_for_patterh
  * request_parsed_files -> gather_source_files
2025-07-09 22:42:20 +02:00
Dominik JainandDominik Jain c4d89f21e7 Move "search for pattern" functionality from LS to Project,
adding all necessary related functionality:
  * Handling of ignored files
  * Enumeration of source files

Functions removed from SolidLanguageServer:
  * index_repository
  * request_parsed_files
  * search_files_for_pattern

Implement SearchForPatternTool without language server
2025-07-09 22:37:57 +02:00
Dominik JainandDominik Jain edb07bc823 Move class Project to new module serena.project 2025-07-09 20:05:59 +02:00
Dominik JainandDominik Jain 19b9bc4e3f Introduce CodeEditor abstraction, removing all editing functions from SymbolManager
and adding LanguageServerCodeEditor as a specialization
2025-07-09 17:20:20 +02:00
Michael PanchenkoandGitHub 3e1b7e1f56 Merge pull request #265 from oraios/refactoring/simplify_ls_setup
Refactoring/simplify ls setup
2025-07-06 23:33:01 +02:00
Joshua ShanksandGitHub f76ed700fa Fix X11/XCB crash when running MCP server in empty directories (#278)
Summary
Fixes X11/XCB crash when running serena-mcp-server in directories without source files
Adds headless environment detection to prevent GUI operations in SSH/WSL/Docker environments
Improves error messages to provide clear guidance when no source files are found
Problem
When running serena-mcp-server --context ide-assistant --project /empty/dir in a headless environment (SSH, WSL, Docker), the application would crash with X11/XCB errors:

[xcb] Unknown sequence number while appending request
[xcb] You called XInitThreads, this is not your fault
[xcb] Aborting, sorry about that.
python: ../../src/xcb_io.c:157: append_pending_request: Assertion `\!xcb_xlib_unknown_seq_number' failed.
Root Cause
Empty directories cause ProjectConfig.autogenerate() to raise a ValueError
The exception handler attempts to show a GUI error dialog using tkinter
In headless environments, tkinter crashes with X11/XCB errors
Solution
Headless Detection: Added is_headless_environment() to detect when running without a display
Skip GUI in Headless: Modified show_fatal_exception_safe() to skip GUI attempts in headless environments
Better Error Messages: Improved the error message for empty projects with clear instructions
2025-07-06 23:21:41 +02:00
Michael PanchenkoandMichael Panchenko 3981f021c6 Minor simplification of tf LS, formatting
Also fixed call to terraform.exe on non-windows platforms
2025-07-06 22:23:21 +02:00
YenandMichael Panchenko 1df9732390 feature/terraform language server support (#277)
Adds terraform support
2025-07-06 22:23:18 +02:00
Michael PanchenkoandMichael Panchenko a24dcea427 Formatting, removed unused vars and imports 2025-07-06 22:23:17 +02:00
Michael Panchenko 7e06148648 Refactoring: added base method ls_resources_dir, used in C# LS 2025-07-06 18:28:22 +02:00
Michael Panchenko 1af8748f6f Merge branch 'main' into refactoring/simplify_ls_setup 2025-07-06 17:28:38 +02:00
Michael Panchenko 65975f4c40 Minor simplification of tf LS, formatting
Also fixed call to terraform.exe on non-windows platforms
2025-07-06 17:27:48 +02:00
YenandGitHub ab24304ceb feature/terraform language server support (#277)
Adds terraform support
2025-07-06 17:15:54 +02:00
Michael Panchenko 5eba8a749b Formatting, removed unused vars and imports 2025-07-06 14:08:07 +02:00
Dominik JainandDominik Jain 58bf161fd2 More flexible handling of enabled tools:
* In addition to exclusion, support notion of "optional tools" that
    are disabled by default and enabled only upon request
  * Unify the handling of inclusions/exclusions across
      - SerenaConfig
      - ProjectConfig
      - SerenaAgentContext
      - SerenaAgentMode
  * Make ToolRegistry a singleton and simplify all related operations
2025-07-06 00:39:36 +02:00
Michael PanchenkoandGitHub 62741a7abd Merge pull request #261 from dbernazal/elixir-support
Elixir Support
2025-07-06 00:13:27 +02:00
Michael Panchenko cf2a0c248b Moved omnisharp module up, minor tweaks
In this state, C# tests with omnisharp as LS mostly pass, except those querying for references
2025-07-06 00:08:40 +02:00
Michael Panchenko e8e417a18e Refactoring, stage 1: move ls implementations one step up
Paths to jsons were adjusted in the modules, minimal change, tests run through
2025-07-05 12:46:37 +02:00
Dominik JainandDominik Jain 5fbed403c9 Update imports in test 2025-07-02 18:44:06 +02:00
Dominik JainandDominik Jain 8577616436 Simplify configuration management, unifying SerenaConfigBase and SerenaConfig
and removing other subclasses
2025-07-02 16:09:25 +02:00
David Bernazal a51eb67534 Extending times for CI 2025-07-02 05:27:41 -05:00
Dominik JainandDominik Jain 49515d6235 Remove process isolation (SerenaMCPFactoryWithProcessIsolation, ProcessIsolatedSerenaAgent, etc.) 2025-07-02 12:20:41 +02:00
David Bernazal bbf15ffc98 Ensure deps are installed 2025-07-01 09:31:04 -05:00
David Bernazal ae4ae5740f Fix ready signal and ignore Elixir tests using skipif 2025-07-01 08:55:40 -05:00
Michael Panchenko 463ea2e4a7 ruff, minor 2025-07-01 14:46:52 +02:00
David Bernazal 2d45a39314 Remove windows tests and fix other tests 2025-07-01 07:33:57 -05:00
David Bernazal e9378ecf79 Fix CI failures: Add missing Elixir test repository source files
The lib/ directory was being ignored by the root .gitignore Python packaging rule.
This caused CI failures because test files like models.ex, services.ex, etc. were
missing from the repository.

- Add exception to .gitignore for test/resources/repos/elixir/test_repo/lib
- Add all missing Elixir source files:
  - examples.ex (example functions and data structures)
  - models.ex (User struct and related functions)
  - services.ex (UserService module)
  - test_repo.ex (main module)
  - utils.ex (utility functions)
  - ignored_dir/ignored_module.ex (for testing directory filtering)

These files are essential for Elixir language server tests to function properly.
2025-07-01 07:33:57 -05:00
David Bernazal 6d7e4a2e5e Address PR #261 feedback: Add Elixir CI support and fix codespell error
- Add Elixir/Erlang setup to pytest.yml using erlef/setup-beam@v1
- Configure Elixir 1.18.4 and OTP 26.1 for CI compatibility
- Fix codespell false positive for '*cripts' glob pattern with ignore comment
- Resolves CI test failures for Elixir language server integration
2025-07-01 07:33:57 -05:00
David Bernazal c665099740 Elixir Support 2025-07-01 07:33:57 -05:00
Michael PanchenkoandGitHub b3f2f168ea Merge pull request #263 from oraios/fix_file_ignores_and_pattern_search
Fix file ignores and pattern search
2025-07-01 14:23:53 +02:00
Michael Panchenko 6c670f54bd Fix in clojure tests: skipif needs a boolean, not a string 2025-07-01 14:23:22 +02:00
Tom LonghurstandGitHub cfe3350c34 Fix C# Language Server (#262)
Now when the language server starts, the initialisation will scan for solution or project files, and then pass them to the language server instructing it to open them. Which in-turn should give us all the nice context since the code is actually being 'loaded' up properly now.
2025-06-30 22:39:44 +02:00
Michael Panchenko 4d3281b7e7 Simplify search_text interface and handling of patterns 2025-06-30 21:17:28 +02:00
Dominik Jain 0d9fb0a196 Formatting 2025-06-29 16:44:37 +02:00
Dominik Jain 974fe95987 Revert "Don't use shell=True on windows, typos"
This reverts commit 548c7b0d2a.
2025-06-29 16:36:01 +02:00
Michael Panchenko 548c7b0d2a Don't use shell=True on windows, typos 2025-06-29 15:35:56 +02:00
Michael Panchenko 0f205013c3 Merge branch 'main' into feature/csharp-language-server 2025-06-29 13:53:50 +02:00
Miguel de Benito Delgado 254526d80d Test serena tools find symbol and find symbol references for clojure 2025-06-29 10:43:14 +02:00
Miguel de Benito Delgado 3bd8c4a944 Factor a couple of constants for clojure tests out 2025-06-29 10:41:17 +02:00