Skip to content

Add ProjectYear and Language to project info screen #757

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
9 changes: 9 additions & 0 deletions vscode-wpilib/src/projectinfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ export interface IProjectInfo {
javaDependenciesExtensionVersion: string;
cppExtensionVersion: string;
vendorLibraries: IVendorLibraryPair[];
wpilibProjectYear: string;
wpilibLanguage: string;
}

async function extensionVersion(extension: vscode.Extension<unknown> | undefined): Promise<string> {
Expand Down Expand Up @@ -85,6 +87,8 @@ export class ProjectInfoGatherer {
Project Version: ${projectInfo.wpilibProjectVersion}
VS Code Version: ${vscode.version}
WPILib Extension Version: ${projectInfo.wpilibExtensionVersion}
Project Year: ${projectInfo.wpilibProjectYear}
Language: ${projectInfo.wpilibLanguage}
C++ Extension Version: ${projectInfo.cppExtensionVersion}
Java Extension Version: ${projectInfo.javaExtensionVersion}
Java Debug Extension Version: ${projectInfo.javaDebugExtensionVersion}
Expand Down Expand Up @@ -118,6 +122,7 @@ Vendor Libraries:

private async getProjectInfo(workspace: vscode.WorkspaceFolder): Promise<IProjectInfo> {
const vendorLibs = await this.vendorLibraries.getCurrentlyInstalledLibraries(workspace);
const prefs = this.externalApi.getPreferencesAPI().getPreferences(workspace);

let currentGradleVersion = await this.wpilibUpdates.getGradleRIOVersion(workspace);

Expand All @@ -133,6 +138,8 @@ Vendor Libraries:
const extensionPackageJson = path.join(extensionContext.extensionPath, 'package.json');
const packageJson = await readFileAsync(extensionPackageJson, 'utf8');
const currentVsCodeVersion: string = json.parse(packageJson).version;
const currentProjectYear: string = prefs.getProjectYear();
const currentLanguage: string = prefs.getCurrentLanguage();

const projectInfo: IProjectInfo = {
cppExtensionVersion: cpp,
Expand All @@ -142,6 +149,8 @@ Vendor Libraries:
vendorLibraries: [],
wpilibExtensionVersion: currentVsCodeVersion,
wpilibProjectVersion: currentGradleVersion,
wpilibProjectYear: currentProjectYear,
wpilibLanguage: currentLanguage,
};

for (const lib of vendorLibs) {
Expand Down