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

Fix matching of editorConfig sections patterns #12953

Merged
merged 8 commits into from
Nov 13, 2024

Conversation

Colengms
Copy link
Collaborator

@Colengms Colengms commented Nov 12, 2024

Fixes: #12933

To resolve: #12529
... we had avoided use of the editorConfig module (which pulled in oneini, which is where the dependency on wasm was coming from). However, my implementation of pattern matching against editorConfig section patterns was too simplistic.

This PR uses minimatch, and code copied directly from: https://github.com/editorconfig/editorconfig-core-js

I also reported the WebAssembly issue in the repo for the editorConfig module: editorconfig/editorconfig-core-js#128

Ideally, if not for the issue with WebAssembly, we should be using the editorConfig module. If that issue gets fixed, we should probably switch back.

Copy link
Collaborator

@sean-mcmanus sean-mcmanus left a comment

Choose a reason for hiding this comment

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

I'm not done reviewing.

Extension/src/LanguageServer/editorConfig.ts Outdated Show resolved Hide resolved
Extension/src/LanguageServer/editorConfig.ts Outdated Show resolved Hide resolved
Extension/src/LanguageServer/editorConfig.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@sean-mcmanus sean-mcmanus 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 if we use code from the editorconfig OSS, we're supposed to add the license info to our ThirdPartyNotices.txt additional dependencies section: https://github.com/microsoft/vscode-cpptools/blob/main/Extension/ThirdPartyNotices.txt#L2444

Copyright © 2012 EditorConfig Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

@Colengms Colengms merged commit 05fbc0e into main Nov 13, 2024
6 checks passed
@Colengms Colengms deleted the dev/coleng/editorconfig_sections branch November 13, 2024 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
2 participants