Remove C# script file support
Turns out we want to add support for class libraries (.cs), but this code added support for C# script files (.csx). I want to leave this code in the git history in case we add support for .csx _in addition_ to .cs
This commit is contained in:
Родитель
8c894060b8
Коммит
c0c0503e65
|
@ -347,7 +347,6 @@
|
|||
"enum": [
|
||||
"Bash",
|
||||
"Batch",
|
||||
"C#",
|
||||
"F#",
|
||||
"Java",
|
||||
"JavaScript",
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"azFunc.showExplorerDescription": "Show or hide the Azure Functions Explorer",
|
||||
"azFunc.templateFilterDescription": "Specify the templates to display when creating a new function. The supported values are 'Verified', 'Core', and 'All'. The 'Verified' category is a subset of 'Core' that has been verified to work with the latest VS Code extension.",
|
||||
"azFunc.projectRuntimeDescription": "The default runtime to use when performing operations in the Azure Functions extension (e.g. \"Create New Function\"). \"~1\" is currently the latest version approved for production use.",
|
||||
"azFunc.projectLanguageDescription": "The default language to use when performing operations in the Azure Functions extension (e.g. \"Create New Function\"). \"C#\", \"F#\", and \"JavaScript\" are currently the only languages approved for production use with runtime \"~1\".",
|
||||
"azFunc.projectLanguageDescription": "The default language to use when performing operations in the Azure Functions extension (e.g. \"Create New Function\"). \"F#\", and \"JavaScript\" are currently the only languages approved for production use with runtime \"~1\".",
|
||||
"azFunc.deploy": "Deploy to Function App",
|
||||
"azFunc.configureDeploymentSource": "Configure Deployment Source",
|
||||
"azFunc.appSettings.add": "Add new setting...",
|
||||
|
|
|
@ -22,7 +22,6 @@ const previewDescription: string = localize('previewDescription', '(Preview)');
|
|||
export enum ProjectLanguage {
|
||||
Bash = 'Bash',
|
||||
Batch = 'Batch',
|
||||
CSharp = 'C#',
|
||||
FSharp = 'F#',
|
||||
Java = 'Java',
|
||||
JavaScript = 'JavaScript',
|
||||
|
@ -51,7 +50,6 @@ async function updateWorkspaceSetting(section: string, value: string): Promise<v
|
|||
export async function selectProjectLanguage(ui: IUserInterface): Promise<ProjectLanguage> {
|
||||
const picks: Pick[] = [
|
||||
new Pick(ProjectLanguage.JavaScript),
|
||||
new Pick(ProjectLanguage.CSharp),
|
||||
new Pick(ProjectLanguage.FSharp),
|
||||
new Pick(ProjectLanguage.Bash, previewDescription),
|
||||
new Pick(ProjectLanguage.Batch, previewDescription),
|
||||
|
@ -161,8 +159,6 @@ export function getFileNameFromLanguage(language: string): string | undefined {
|
|||
return 'run.sh';
|
||||
case ProjectLanguage.Batch:
|
||||
return 'run.bat';
|
||||
case ProjectLanguage.CSharp:
|
||||
return 'run.csx';
|
||||
case ProjectLanguage.FSharp:
|
||||
return 'run.fsx';
|
||||
case ProjectLanguage.JavaScript:
|
||||
|
|
|
@ -113,20 +113,6 @@ const launchJsonForJava: {} = {
|
|||
]
|
||||
};
|
||||
|
||||
const launchJsonForCSharp: {} = {
|
||||
version: '0.2.0',
|
||||
configurations: [
|
||||
{
|
||||
name: localize('azFunc.attachToCSharpFunc', 'Attach to C# Functions'),
|
||||
type: 'mono',
|
||||
request: 'attach',
|
||||
address: 'localhost',
|
||||
port: 55555,
|
||||
preLaunchTask: taskId
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
// tslint:disable-next-line:no-multiline-string
|
||||
const gitignore: string = `bin
|
||||
obj
|
||||
|
@ -229,7 +215,6 @@ export async function createNewProject(telemetryProperties: { [key: string]: str
|
|||
// Only display 'supported' languages that can be debugged in VS Code
|
||||
const languagePicks: Pick[] = [
|
||||
new Pick(ProjectLanguage.JavaScript),
|
||||
new Pick(ProjectLanguage.CSharp),
|
||||
new Pick(ProjectLanguage.Java)
|
||||
];
|
||||
const language: string = (await ui.showQuickPick(languagePicks, localize('azFunc.selectFuncTemplate', 'Select a language for your function project'))).label;
|
||||
|
@ -291,9 +276,6 @@ export async function createNewProject(telemetryProperties: { [key: string]: str
|
|||
case ProjectLanguage.Java:
|
||||
await fsUtil.writeFormattedJson(launchJsonPath, launchJsonForJava);
|
||||
break;
|
||||
case ProjectLanguage.CSharp:
|
||||
await fsUtil.writeFormattedJson(launchJsonPath, launchJsonForCSharp);
|
||||
break;
|
||||
default:
|
||||
await fsUtil.writeFormattedJson(launchJsonPath, launchJsonForJavaScript);
|
||||
break;
|
||||
|
@ -305,7 +287,6 @@ export async function createNewProject(telemetryProperties: { [key: string]: str
|
|||
let runtime: ProjectRuntime;
|
||||
switch (language) {
|
||||
case ProjectLanguage.Java:
|
||||
case ProjectLanguage.CSharp:
|
||||
runtime = ProjectRuntime.beta;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -40,11 +40,7 @@ export class TemplateData {
|
|||
'HttpTriggerWithParameters-JavaScript',
|
||||
'ManualTrigger-JavaScript',
|
||||
'QueueTrigger-JavaScript',
|
||||
'TimerTrigger-JavaScript',
|
||||
'BlobTrigger-CSharp',
|
||||
'HttpTrigger-CSharp',
|
||||
'QueueTrigger-CSharp',
|
||||
'TimerTrigger-CSharp'
|
||||
'TimerTrigger-JavaScript'
|
||||
];
|
||||
|
||||
private readonly _javaTemplates: string[] = [
|
||||
|
|
|
@ -59,24 +59,6 @@ suite('Create New JavaScript Project Tests', () => {
|
|||
}).timeout(10 * 1000);
|
||||
});
|
||||
|
||||
suite('Create New C# Project Tests', () => {
|
||||
|
||||
suiteSetup(async () => {
|
||||
await fse.ensureDir(testFolderPath);
|
||||
});
|
||||
|
||||
suiteTeardown(async () => {
|
||||
outputChannel.dispose();
|
||||
await fse.remove(testFolderPath);
|
||||
});
|
||||
|
||||
const javaScriptProject: string = 'CSharpProject';
|
||||
test(javaScriptProject, async () => {
|
||||
await testCreateNewProject(ProjectLanguage.CSharp);
|
||||
await testProjectFilesExist(testFolderPath);
|
||||
}).timeout(10 * 1000);
|
||||
});
|
||||
|
||||
async function testCreateNewProject(language: string, ...inputs: (string | undefined)[]): Promise<void> {
|
||||
// Setup common inputs
|
||||
inputs.unshift(language); // Specify the function name
|
||||
|
|
|
@ -16,11 +16,6 @@ suite('Template Data Tests', () => {
|
|||
assert.equal(templates.length, 8);
|
||||
});
|
||||
|
||||
test('Default C# Templates Count', async () => {
|
||||
const templates: Template[] = await templateData.getTemplates(ProjectLanguage.CSharp, ProjectRuntime.beta, TemplateFilter.Verified);
|
||||
assert.equal(templates.length, 4);
|
||||
});
|
||||
|
||||
test('Default Java Templates Count', async () => {
|
||||
const templates: Template[] = await templateData.getTemplates(ProjectLanguage.Java, ProjectRuntime.beta, TemplateFilter.Verified);
|
||||
assert.equal(templates.length, 4);
|
||||
|
|
Загрузка…
Ссылка в новой задаче