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

Follow directions in the VS Code API docs for relative paths #2590

Merged
merged 3 commits into from
Oct 15, 2022

Conversation

mattseddon
Copy link
Member

@mattseddon mattseddon commented Oct 14, 2022

Possible cause of #2562 and some of the stability issues that we've been seeing.

From the API:

    /**
     * A relative pattern is a helper to construct glob patterns that are matched
     * relatively to a base file path. The base path can either be an absolute file
     * path as string or uri or a {@link WorkspaceFolder workspace folder}, which is the
     * preferred way of creating the relative pattern.
     */
    export class RelativePattern {
...
         * @param base A base to which this pattern will be matched against relatively. It is recommended
         * to pass in a {@link WorkspaceFolder workspace folder} if the pattern should match inside the workspace.
         * Otherwise, a uri or string should only be used if the pattern is for a file path outside the workspace.
         * @param pattern A file glob pattern like `*.{ts,js}` that will be matched on paths relative to the base.
         */
        constructor(base: WorkspaceFolder | Uri | string, pattern: string);

The important line: Otherwise, a uri or string should only be used if the pattern is for a file path outside the workspace.

@mattseddon mattseddon self-assigned this Oct 14, 2022
@mattseddon mattseddon added bug Something isn't working and removed 🏠 housekeeping labels Oct 14, 2022
@mattseddon mattseddon force-pushed the update-relative-paths branch 2 times, most recently from 9b458fb to 7fdd5f3 Compare October 14, 2022 05:18
@mattseddon mattseddon marked this pull request as ready for review October 14, 2022 06:03
@mattseddon mattseddon force-pushed the update-relative-paths branch from 7fdd5f3 to da09052 Compare October 14, 2022 10:14
@mattseddon mattseddon force-pushed the update-relative-paths branch from da09052 to a1ee181 Compare October 14, 2022 10:15
Copy link
Contributor

@julieg18 julieg18 left a comment

Choose a reason for hiding this comment

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

Looks good!

@codeclimate
Copy link

codeclimate bot commented Oct 15, 2022

Code Climate has analyzed commit 52a5268 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (85% is the threshold).

This pull request will bring the total coverage in the repository to 96.8% (0.0% change).

View more on Code Climate.

@mattseddon mattseddon merged commit 58c57e9 into main Oct 15, 2022
@mattseddon mattseddon deleted the update-relative-paths branch October 15, 2022 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants