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

Allow root meson.build files to be symlinks #208

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## next

- Also check for root `meson.build` files which are symlinks

## 1.19.1

- Fix extension not calling Meson correctly in some circumstances like Cygwin
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export async function mesonRootDirs(): Promise<string[]> {
let hasMesonFile: boolean = false;
let subdirs: vscode.Uri[] = [];
for (const [name, type] of await vscode.workspace.fs.readDirectory(d)) {
if (type === vscode.FileType.File && name == "meson.build") {
if ((type === vscode.FileType.File || type === vscode.FileType.SymbolicLink) && name == "meson.build") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if ((type === vscode.FileType.File || type === vscode.FileType.SymbolicLink) && name == "meson.build") {
if ((type === vscode.FileType.File || type === (vscode.FileType.File | vscode.FileType.SymbolicLink)) && name == "meson.build") {

AFAICT this is the correct check. Based on this sample, and the debugger showing type is 65 for symlinked files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. Can you submit a PR? I'll cook up a release tomorrow. Sorry!

rootDirs.push(d.fsPath);
hasMesonFile = true;
break;
Expand Down