Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor clangd preferences #196

Merged
merged 13 commits into from
Sep 15, 2023

Conversation

ghentschke
Copy link
Contributor

@ghentschke ghentschke commented Sep 8, 2023

separated editor from clangd preferences (needed for #178)

image
image
image

@ghentschke ghentschke changed the title Refactor clangd prefernces Refactor clangd preferences Sep 8, 2023
@ghentschke
Copy link
Contributor Author

Okay, IMO the refactoring is done. When this LSP4E issue has been merged, I'll apply the FormatOnSave implementation.

I know, it has become a larger PR :-/
But I hope @ruspl-afed you have time to take a look.

@jonahgraham
Copy link
Member

Okay, IMO the refactoring is done. When this eclipse/lsp4e#783 has been merged, I'll apply the FormatOnSave implementation.

Does this mean that CDT LSP will depend on a new version of LSP4E being released with that PR?

@ghentschke
Copy link
Contributor Author

ghentschke commented Sep 11, 2023

Does this mean that CDT LSP will depend on a new version of LSP4E being released with that PR?

Yes. Thats's why I commented out FormatOnSave. But when I think about it, it would be better to remove the format-on-save stuff from this refactoring PR.

@ghentschke
Copy link
Contributor Author

Hm, after merging the master into the PR the licence check failed.

@jonahgraham
Copy link
Member

Hm, after merging the master into the PR the licence check failed.

Looks like temp error - I have restarted the check

@jonahgraham
Copy link
Member

BTW the error was:

Failed to execute goal org.eclipse.dash:license-tool-plugin:1.0.3-SNAPSHOT:license-check (default-cli) on project org.eclipse.cdt.lsp.root: Execution default-cli of goal org.eclipse.dash:license-tool-plugin:1.0.3-SNAPSHOT:license-check failed: Plugin org.eclipse.dash:license-tool-plugin:1.0.3-SNAPSHOT or one of its dependencies could not be resolved: Failed to collect dependencies at org.eclipse.dash:license-tool-plugin:jar:1.0.3-20230911.055036-111 -> org.eclipse.dash:org.eclipse.dash.licenses:jar:1.0.3-SNAPSHOT: Failed to read artifact descriptor for org.eclipse.dash:org.eclipse.dash.licenses:jar:1.0.3-SNAPSHOT: The following artifacts could not be resolved: org.eclipse.dash:org.eclipse.dash.licenses:pom:1.0.3-20230911.055036-111 (absent): Could not transfer artifact org.eclipse.dash:org.eclipse.dash.licenses:pom:1.0.3-20230911.055036-111 from/to dash-licenses-snapshots (https://repo.eclipse.org/content/repositories/dash-licenses-snapshots/): status code: 403, reason phrase: Forbidden (403) -> [Help 1]

@jonahgraham
Copy link
Member

Hm, after merging the master into the PR the licence check failed.

Looks like temp error - I have restarted the check

Worked now.

@ghentschke
Copy link
Contributor Author

ghentschke commented Sep 13, 2023

In my latest commit I added the format-on-save feature again, because the LSP4E PR #783 has been merged.

@jonahgraham Does this bring us into trouble, because the cdt-lsp release depends then on the LSP4E snapshot?

Copy link
Member

@jonahgraham jonahgraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my latest commit I added the format-on-save feature again, because the LSP4E PR #783 has been merged.

@jonahgraham Does this bring us into trouble, because the cdt-lsp release depends then on the LSP4E snapshot?

Yes :-(

A few items aren't working as expected (but I haven't looked at preferences closely in a while, so some of these may not be new):

  • The "Enable project-specific settings" checkbox in the UI is not initialized correctly in the project properties. As you can see in this screenshot the settings say to format, but opening the page it is unchecked:

image

  • The "Configure Workspace Settings" in the project properties goes to the correct preference page, but the tree on the left is incorrect only showing the root node

image

import org.osgi.service.component.annotations.Reference;

@Component(property = { "serverDefinitionId:String=org.eclipse.cdt.lsp.server" })
public class FormatOnSave implements IFormatRegionsProvider {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this new class reference we should the MANIFEST entry should be updated to a version that will include it - i.e.:

org.eclipse.lsp4e;bundle-version="0.17.2",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a LSP4E PR to bump the version to 0.17.3. Then we can increase it here to 0.17.3 as well

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately that means we can't release CDT LSP because it depends on an unreleased LSP4E. We can:

  • Not merge this change and do release of 1.0.0 as is
  • Remove the format on save changes from this PR, so that we are dependent on 0.17.1 of LSP4E
  • Request and wait for LSP4E to release and then add the new version of LSP4E to our p2 site so it can be installed by users

WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Option 4 is we do a soft/milestone "release" which can depend on snapshot LSP4E

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the format on save changes from this PR, so that we are dependent on 0.17.1 of LSP4E

I would prefer this one. I'll put the format-on-save stuff in a new PR.

ghentschke and others added 9 commits September 14, 2023 06:03
There is no OSGi service implementation needed in LSP4E. The service
should be provided by external bundles.
- separated editor from clangd preferences (needed for eclipse-cdt#178)
since the classes are used in project properties and workspace
preferences.
- make lsp.editor classes extendable for clangd
it should be checked in performOk only
to prevent duplicated code
can be (re)added when LSP4E PR eclipse/lsp4e#783
has been merged
ghentschke and others added 4 commits September 14, 2023 11:05
The restart clangd dialog should be opened when:
- The clangd options have been modified
or
- The user modifies the 'Enable project-specific settings' and the
clangd options on project level differ from workspace
or
- 'Restore Defaults' in project scope should trigger dialog only if the
project options differ from workspace.
since it depends on not yet released LSP4E dependency.
@ghentschke
Copy link
Contributor Author

@jonahgraham Please check the last two commits. I removed the format-on-save stuff and dependency on LSP4E 0.17.3

Copy link
Member

@jonahgraham jonahgraham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - once merged I will start release process

@jonahgraham
Copy link
Member

LGTM - once merged I will start release process

PS I will create an endgame issue like eclipse-cdt/cdt#548, and I'll document all the steps I take to try to make sure that others are able to do it in the future.

@ghentschke ghentschke merged commit aaf3f80 into eclipse-cdt:master Sep 15, 2023
3 checks passed
@ghentschke
Copy link
Contributor Author

@jonahgraham Thank you!

@jonahgraham jonahgraham added this to the 1.0.0 milestone Sep 18, 2023
@ghentschke ghentschke deleted the implement-IFormatOnSave branch September 19, 2023 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants