package.json: use golang.go in the main dev branch

Since we are now maintaining golang.go and that is our main extension,
this makes more sense and also, will help existing Go users who want
to make and test a small change quickly.

- Rename src/telemetry.ts to src/const.ts because there is no
telemetry related code in the file.
- Move docs/nightly back to build/nightly, because they are meant to be
used during the nightly release process, rather than to serve as
documentation for end users.

In the nightly release, we replace the extension id with golang.go-nightly,
combine README.md with build/nightly/README.md, and replace src/const.ts
with build/nightly/const.ts.

Change-Id: Ife274f6caa6d6b2a1ab8873d2ed540f4580bcd33
This commit is contained in:
Hana (Hyang-Ah) Kim 2020-06-16 23:18:22 -04:00
Родитель a2367906af
Коммит 0a720d0c3e
11 изменённых файлов: 31 добавлений и 18 удалений

Просмотреть файл

@ -77,10 +77,12 @@ prepare_nightly() {
.bugs.url="https://github.com/golang/vscode-go/issues"
') > /tmp/package.json && mv /tmp/package.json package.json
# Replace CHANGELOG.md with CHANGELOG.md.nightly + Release commit info.
printf "**Release ${VER} @ ${COMMIT}** \n\n" | cat - docs/nightly/CHANGELOG.md > /tmp/CHANGELOG.md.new && mv /tmp/CHANGELOG.md.new CHANGELOG.md
# Replace CHANGELOG.md with CHANGELOG.md + Release commit info.
printf "**Release ${VER} @ ${COMMIT}** \n\n" | cat - CHANGELOG.md > /tmp/CHANGELOG.md.new && mv /tmp/CHANGELOG.md.new CHANGELOG.md
# Replace the heading of README.md with the heading for Go Nightly.
sed '/^# Go for Visual Studio Code$/d' README.md | cat docs/nightly/README.md - > /tmp/README.md.new && mv /tmp/README.md.new README.md
sed '/^# Go for Visual Studio Code$/d' README.md | cat build/nightly/README.md - > /tmp/README.md.new && mv /tmp/README.md.new README.md
# Replace src/const.ts with build/nightly/const.ts.
cp build/nightly/const.ts src/const.ts
}
main() {

Просмотреть файл

Просмотреть файл

@ -1,8 +1,9 @@
/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
* Modification copyright 2020 The Go Authors. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------*/
// TODO(hyangah): move this somewhere else (where easily modifiable during release process)
// This file contains constants that replace constants defined in src/const.ts when building Nightly
export const extensionId: string = 'golang.go-nightly';

Просмотреть файл

@ -1,4 +0,0 @@
## 2020.3.x
* Set the extension name for VS Code Go Nightly(`go-nightly`).
* Pick up the pre-release version of `gopls` if available.
* Disabled the telemetry report for VS Code Go.

4
package-lock.json сгенерированный
Просмотреть файл

@ -1,6 +1,6 @@
{
"name": "go-nightly",
"version": "0.0.0",
"name": "go",
"version": "0.15.0-dev",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

Просмотреть файл

@ -1,9 +1,9 @@
{
"name": "go-nightly",
"displayName": "Go Nightly",
"version": "0.0.0",
"name": "go",
"displayName": "Go",
"version": "0.15.0-dev",
"publisher": "golang",
"description": "Rich Go language support for Visual Studio Code (Nightly)",
"description": "Rich Go language support for Visual Studio Code",
"author": {
"name": "Go Team at Google"
},

12
src/const.ts Normal file
Просмотреть файл

@ -0,0 +1,12 @@
/*---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
* Modification copyright 2020 The Go Authors. All rights reserved.
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------*/
// This file contains constants that need to change when building Nightly or Go2Go.
//
// For example, we replace this file with the version in the build/nightly.
// Make sure to reflect any changes in this file to build/nightly/const.ts.
export const extensionId: string = 'golang.go';

Просмотреть файл

@ -20,6 +20,7 @@ import {
RevealOutputChannelOn,
} from 'vscode-languageclient';
import WebRequest = require('web-request');
import { extensionId } from './const';
import { GoDefinitionProvider } from './goDeclaration';
import { toolExecutionEnvironment } from './goEnv';
import { GoHoverProvider } from './goExtraInfo';
@ -446,7 +447,6 @@ function allFoldersHaveSameGopath(): boolean {
return vscode.workspace.workspaceFolders.find((x) => tempGopath !== getCurrentGoPath(x.uri)) ? false : true;
}
const acceptGoplsPrerelease = true; // For nightly, we accept the prerelease version.
export async function shouldUpdateLanguageServer(
tool: Tool,
languageServerToolPath: string,
@ -549,6 +549,8 @@ export const getTimestampForVersion = async (tool: Tool, version: semver.SemVer)
return time;
};
const acceptGoplsPrerelease = (extensionId === 'golang.go-nightly');
export const getLatestGoplsVersion = async (tool: Tool) => {
// If the user has a version of gopls that we understand,
// ask the proxy for the latest version, and if the user's version is older,

Просмотреть файл

@ -12,6 +12,7 @@ import kill = require('tree-kill');
import util = require('util');
import vscode = require('vscode');
import { NearestNeighborDict, Node } from './avlTree';
import { extensionId } from './const';
import { toolExecutionEnvironment } from './goEnv';
import { buildDiagnosticCollection, lintDiagnosticCollection, vetDiagnosticCollection } from './goMain';
import { getCurrentPackage } from './goModules';
@ -24,7 +25,6 @@ import {
resolveHomeDir,
} from './goPath';
import { outputChannel } from './goStatus';
import { extensionId } from './telemetry';
let userNameHash: number = 0;

Просмотреть файл

@ -7,7 +7,7 @@ import cp = require('child_process');
import * as fs from 'fs-extra';
import * as path from 'path';
import * as vscode from 'vscode';
import { extensionId } from '../../src/telemetry';
import { extensionId } from '../../src/const';
// Env is a collection of test related variables
// that define the test environment such as vscode workspace.

Просмотреть файл

@ -1,7 +1,7 @@
import * as fs from 'fs-extra';
import * as path from 'path';
import { runTests } from 'vscode-test';
import { extensionId } from '../src/telemetry';
import { extensionId } from '../src/const';
async function main() {
// The folder containing the Extension Manifest package.json