-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
doc about findFiles in vscode-api #38464
Comments
What do you mean, it doesn't work? Please include more details. |
@roblourens I just mean the document of vscode api should not use wrong backslash ( ∕ ) should use ( / ). |
Oh I see, it is using a fancy slash character. @octref Do you know why that is? Copy/paste of that code snippet doesn't work. |
That's the question... I have used a weird unicode character because glob-patterns in comments tend to end the comment... I could use backslashes instead of that character but I am unsure how we handle backslashes in glob-patterns... |
I would rather encourage people to use forward slash, which looks better and is less-likely to break cross-platform. Especially given #32533 Can we fix it on the website's end then? |
Agreed. Problem is in JSDoc this would break syntax-highlight (same for GitHub). /**
* findFiles('**/*.js', '**/node_modules/**', 10)
*/ So there are two solutions:
|
I don't think we can fix it with the grammar, if you write that then it's simply not valid TS/JS. Let's use the special character and fix it for the website. |
Yes, this is part of the ecmascript spec. We cannot change it. I thought you could escape this as |
@jrieken Do you mind reverting the changes then? I'll look for the special char and replace it wish slash in website build scripts. |
Well, that will only help the website not with the doc hover and other in-tool-experiences... I still think backslash is fair. @roblourens Is there a way for you to fix escape characters? |
To fix backslashes or special slash characters? |
backslashes. our glob library apparently handles them already (correctly? @bpasero can I match on a name with backslash in it?, e.g |
I guess so. The comment will have to have a double backslash though. It's annoying that we have to work around it like this just because it's encoded in a block comment, but I can't think of a better solution. |
Hm, create a folder with backslashes in it's name? It being filtered would be the correct behaviour which also means we treat a backslash like a name-character (not separator) on these platforms... |
@jrieken it is not valid to have backslash in glob patterns but for the target paths that we match on it can either be backslash or slash, we normalize it. |
Really, but it's valid to have backslashes in filenames. Is that the glob-definition or our implementation or it? |
@jrieken at least the node-glob library calls out to this issue (https://github.com/isaacs/node-glob#windows) and others (https://www.tcl.tk/man/tcl/TclCmd/glob.htm) also seem to remind people to not use backslashes. I think the This is also repeated in http://man7.org/linux/man-pages/man7/glob.7.html which is probably the first glob implementation.
Yes, any mix of slash or backslash on any OS will produce the same result. |
I now use |
This will be deployed to the website in our next release. |
below code come from vscode
when i copy the example code from vscode,
it can work fine before 1.18.0, but after 1.18.0, it can't work.
Actually i find that the backslash ( ∕ ) in the code is so strange, it should be ( / ).
Can you fix the mistake?
The text was updated successfully, but these errors were encountered: