-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from badsyntax/sln-file
Remove reliance on .sln file
- Loading branch information
Showing
25 changed files
with
161 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,7 @@ | |
}, | ||
"cSpell.language": "en-GB", | ||
"cSpell.words": [ | ||
"ASPNETCORE", | ||
"color", | ||
"dbcontext", | ||
"efcore", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export const DB_CONTEXT_MODEL_SNAPSHOT_SUFFIX = 'ModelSnapshot.cs'; | ||
|
||
export const EXTENSION_NAMESPACE = 'entityframework'; | ||
|
||
export const TERMINAL_NAME = 'ef-migrations'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import * as vscode from 'vscode'; | ||
import path from 'node:path'; | ||
import { parseProject } from 'vs-parse'; | ||
import type { ProjectFile } from '../types/ProjectFile'; | ||
|
||
export class ProjectFilesProvider { | ||
public static async getProjectFiles() { | ||
const workspaceRoots = vscode.workspace.workspaceFolders || []; | ||
|
||
const projects: ProjectFile[] = []; | ||
|
||
for (const workspaceRoot of workspaceRoots) { | ||
const projectFiles = await vscode.workspace.findFiles( | ||
new vscode.RelativePattern(workspaceRoot, '**/*.csproj'), | ||
); | ||
for (const projectFile of projectFiles) { | ||
const project = await parseProject(projectFile.fsPath); | ||
const hasEFDesignPackage = | ||
(project.packages || []).find( | ||
pkg => pkg.name === 'Microsoft.EntityFrameworkCore.Design', | ||
) !== undefined; | ||
if (hasEFDesignPackage) { | ||
const projectName = path.basename(path.dirname(projectFile.fsPath)); | ||
projects.push({ | ||
name: projectName, | ||
project, | ||
workspaceRoot: workspaceRoot.uri.fsPath, | ||
path: projectFile.fsPath, | ||
}); | ||
} | ||
} | ||
} | ||
|
||
return projects; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.