-
Notifications
You must be signed in to change notification settings - Fork 676
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
Add nag message when project.json projects are opened #1657
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ import { addAssetsIfNecessary, AddAssetResult } from '../assets'; | |
import { sum, safeLength } from '../common'; | ||
import * as utils from './utils'; | ||
|
||
export function activate(context: vscode.ExtensionContext, reporter: TelemetryReporter) { | ||
export function activate(context: vscode.ExtensionContext, reporter: TelemetryReporter, channel: vscode.OutputChannel) { | ||
const documentSelector: vscode.DocumentSelector = { | ||
language: 'csharp', | ||
scheme: 'file' // only files from disk | ||
|
@@ -88,6 +88,25 @@ export function activate(context: vscode.ExtensionContext, reporter: TelemetryRe | |
})); | ||
} | ||
|
||
// After server is started (and projects are loaded), check to see if there are | ||
// any project.json projects. If so, notify the user about migration. | ||
disposables.push(server.onServerStart(() => { | ||
utils.requestWorkspaceInformation(server) | ||
.then(workspaceInfo => { | ||
if (workspaceInfo.DotNet && workspaceInfo.DotNet.Projects.length > 0) { | ||
const shortMessage = 'project.json is no longer a supported project format for .NET Core applications.'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You have MSWord style quotes in this string. Expected? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm... I'm not spotting them There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, somehow got this comment on the wrong line. See There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW, my phone was hiding them and printing normal quotes. Good catch! |
||
const detailedMessage = "Warning: project.json is no longer a supported project format for .NET Core applications. Update to the latest version of .NET Core (https://aka.ms/netcoredownload) and use ‘dotnet migrate’ to upgrade your project (see https://aka.ms/netcoremigrate for details)."; | ||
const moreDetailItem: vscode.MessageItem = { title: 'More Detail' }; | ||
|
||
vscode.window.showWarningMessage(shortMessage, moreDetailItem) | ||
.then(item => { | ||
channel.appendLine(detailedMessage); | ||
channel.show(); | ||
}); | ||
} | ||
}); | ||
})); | ||
|
||
// Send telemetry about the sorts of projects the server was started on. | ||
disposables.push(server.onServerStart(() => { | ||
let measures: { [key: string]: number } = {}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this fire for the old PCL projects that use project.json for dependencies but still have a .csproj? Do you want to deprecate those as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. Just for project.json files that are handled as projects.