Skip to content

fix: filter 'quickfix' code action for IJ intention - #218

Merged
fbricon merged 1 commit into
redhat-developer:mainfrom
angelozerr:filter_quickfix_codeaction
Apr 16, 2024
Merged

fbricon merged 1 commit into
redhat-developer:mainfrom
angelozerr:filter_quickfix_codeaction

Conversation

@angelozerr

Copy link
Copy Markdown
Contributor

fix: filter 'quickfix' code action for IJ intention

@angelozerr angelozerr self-assigned this Apr 16, 2024
@angelozerr angelozerr added bug Something isn't working codeAction labels Apr 16, 2024
@angelozerr angelozerr added this to the 0.0.1 milestone Apr 16, 2024
@codecov

codecov Bot commented Apr 16, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 18.99%. Comparing base (dd09b09) to head (d4e5344).

Files Patch % Lines
...ction/intention/LSPIntentionCodeActionSupport.java 0.00% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main     #218    +/-   ##
========================================
  Coverage   18.98%   18.99%            
========================================
  Files         232      232            
  Lines        7807     7804     -3     
  Branches     1435     1059   -376     
========================================
  Hits         1482     1482            
+ Misses       6062     6059     -3     
  Partials      263      263            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@angelozerr
angelozerr force-pushed the filter_quickfix_codeaction branch from bce6ec8 to d4e5344 Compare April 16, 2024 08:17
@fbricon
fbricon merged commit ade26c1 into redhat-developer:main Apr 16, 2024
@fbricon

fbricon commented Apr 16, 2024

Copy link
Copy Markdown
Contributor

thanks @angelozerr!

angelozerr pushed a commit that referenced this pull request Oct 27, 2026
…pose (#1776)

* fix: close a server connection that a start opens after a stop or dispose

LanguageServerWrapper.start() creates the connection on a pooled
thread. A stop or a dispose while it did, or before the start, as when
a document connects late, found no connection to close, and the start
then opened it. A dispose also cancels the rest of the start, so its
error handler, which stops the connection, is skipped. Nothing closed
the connection: the language server's process kept running, or, in
tests, the mock language server's thread which reads the connection,
as LanguageServerFileEnablementTest reported on macOS:

    Thread leaked: Thread[#218,pool-3-thread-2,5,main] (alive) RUNNABLE
      at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen

Once the connection is started, the start now checks, under the
wrapper's lock, whether the language server was disposed or this start
was stopped, and if so closes the connection itself.

Tests: LanguageServerWrapperDisposeWhileStartingTest. A dispose while
the connection is created, and a start after a dispose, close the
connection, the second before the start's error notification; both fail
without the change. ./gradlew test: 831 tests, 3 skipped, and the 7
macOS-only failures main has.

* test: let the mock connection be stopped from two threads at once

After CodeRabbit's review: a stop while a language server starts can
now stop its connection twice, from the stop's thread and from the
start's, which closes the connection it opened after the stop. The
connection providers of LSP4IJ allow it: OSProcessStreamConnectionProvider
synchronizes stop() and ignores a second one, and
ProcessStreamConnectionProvider only destroys its process. But
MockConnectionProvider.stop() iterates and clears a plain list, and two
stops at once could throw, which would leave the server stopping.

MockConnectionProvider.start() and stop() now take turns.

Tests: LanguageServerWrapperDisposeWhileStartingTest gains a stop, not a
dispose, while the connection is created, which closes the connection;
it fails without the check of the start's context. ./gradlew test: 832
tests, 3 skipped, and the 7 macOS-only failures main has.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working codeAction

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants