tools icon indicating copy to clipboard operation
tools copied to clipboard

fix(rome_lsp): improve the pattern matching logic for ignored files

Open leops opened this issue 3 years ago • 1 comments

Summary

Fixes #3790

This PR fixes how ignore patterns are parsed and changes how paths are represented in the language server to reduce discrepancies with the CLI. For ignore patterns, the parse will now strip the ./ prefix from the input string, and prepend the pattern with a ** group if the input string doesn't start with an absolute filesystem path. For the Language Server, the logic converting URIs into RomePath will now try to strip the path to the root of the workspace from the path of the file, which has the effect of making most paths relative much like they generally are on the CLI.

Test Plan

I've update the tests for the file ignores on the CLI to check that various forms of ignore patterns are all working correctly. I also modified the LSP tests to ensure it only constructs URIs that can be turned into valid paths for the underlying OS.

leops avatar Dec 09 '22 16:12 leops

Deploy Preview for docs-rometools canceled.

Name Link
Latest commit c95ea004c8ab6aac4d7c0a66ae4bfbfd36fe4ddb
Latest deploy log https://app.netlify.com/sites/docs-rometools/deploys/6398576966b73100082a594e

netlify[bot] avatar Dec 09 '22 16:12 netlify[bot]