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

LSP: Allow for an LSP extension match on any suffix, not just filename and ext #11322

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

nathansbradshaw
Copy link

Angular shares file extensions with html and ts. It is conventional for an angular file to follow the format *.component.html or *.component.ts. This PR allows LSP to add an optional Language detection field called path_regex that can be used to sort out duplicate Languages, such as in the case of angular files.

Release Notes:

  • Added Path_Regex option for LSP configs

Copy link

cla-bot bot commented May 2, 2024

We require contributors to sign our Contributor License Agreement, and we don't have @nb-midwestern on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@nb-midwestern
Copy link

@cla-bot check

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label May 2, 2024
Copy link

cla-bot bot commented May 2, 2024

The cla-bot has been summoned, and re-checked this pull request!

@mrnugget mrnugget requested review from maxbrunsfeld, SomeoneToIgnore and maxdeviant and removed request for SomeoneToIgnore May 3, 2024 09:28
@zed-industries-bot
Copy link

Warnings
⚠️

This PR is missing release notes.

Please add a "Release Notes" section that describes the change:

Release Notes:

- (Added|Fixed|Improved) ... ([#<public_issue_number_if_exists>](https://github.com/zed-industries/zed/issues/<public_issue_number_if_exists>)).

If your change is not user-facing, you can use "N/A" for the entry:

Release Notes:

- N/A

Generated by 🚫 dangerJS against 7d78e3b

Copy link
Member

@maxdeviant maxdeviant left a comment

Choose a reason for hiding this comment

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

I think we may just want to extend path_suffixes to handle these cases.

Adding a separate configuration option feels weird.

@maxbrunsfeld
Copy link
Collaborator

I agree, it seems like a path_suffixes need to not just match against the extension and the filename, but rather split the filename on a ., and check if any suffix of that split list matches the entry.

@nathansbradshaw nathansbradshaw changed the title LSP: Allow for an LSP extension to use Regex to determine when it should be applied LSP: Allow for an LSP extension match on any suffix, not just filename and ext May 4, 2024
@mikayla-maki mikayla-maki self-assigned this May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants