Skip to content

Commit

Permalink
Merge 5f45a36 into 4a2dabe
Browse files Browse the repository at this point in the history
  • Loading branch information
kanej authored Apr 18, 2023
2 parents 4a2dabe + 5f45a36 commit b882236
Show file tree
Hide file tree
Showing 43 changed files with 529 additions and 432 deletions.
1 change: 1 addition & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"env": {
"VSCODE_NODE_ENV": "development"
},
"envFile": "${workspaceFolder}/.env",
"preLaunchTask": {
"type": "npm",
"script": "watch"
Expand Down
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ From the root directory run a build:
npm install && npm run build
```

If you intend to develop against our analytics you should setup a `.env` file in the root of the repository:

```shell
cp env.example .env
```

The analytics secrets will need then to be populated.

### 2. Open the repo in **vscode**

VSCode is assumed as the development environment as it has inbuilt support for developing VSCode extesions. To open the repository in VSCode from the command line run:
Expand Down
10 changes: 10 additions & 0 deletions client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## 0.6.16 - 2023-04-18

### Changed

- Move formatting to language server, to allow use from CoC ([#300](https://github.com/NomicFoundation/hardhat-vscode/issues/300))

### Fixed

- Suppress file access errors on scans ([#448](https://github.com/NomicFoundation/hardhat-vscode/issues/448))

## 0.6.15 - 2023-03-30

### Added
Expand Down
9 changes: 4 additions & 5 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"displayName": "Solidity",
"description": "Solidity and Hardhat support by the Hardhat team",
"license": "MIT",
"version": "0.6.15",
"version": "0.6.16",
"private": true,
"main": "./out/extension.js",
"module": "./out/extension.js",
Expand Down Expand Up @@ -58,13 +58,12 @@
"@types/prettier": "2.6.0",
"@types/vscode": "^1.70",
"eslint": "^7.23.0",
"rimraf": "3.0.2"
"rimraf": "3.0.2",
"prettier": "2.5.1"
},
"dependencies": {
"@nomicfoundation/solidity-language-server": "0.6.15",
"@nomicfoundation/solidity-language-server": "0.6.16",
"@sentry/node": "6.19.1",
"prettier": "2.5.1",
"prettier-plugin-solidity": "1.1.2",
"vscode-languageclient": "^7.0.0"
},
"contributes": {
Expand Down
37 changes: 37 additions & 0 deletions client/scripts/bundle.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node
/* eslint-disable no-console */
/* eslint-disable @typescript-eslint/no-var-requires */
require("dotenv").config({ path: "../.env" });
const fs = require("fs");
const path = require("path");
const { exec } = require("child_process");
Expand Down Expand Up @@ -37,6 +38,41 @@ function ensureDirExists(dir) {
}

async function main() {
if (!process.env.SOLIDITY_GA_SECRET) {
console.warn(
"\n\n SOLIDITY_GA_SECRET not set, have you added a .env file based on the example?\n\n"
);
} else {
console.log(`Read SOLIDITY_GA_SECRET from .env file`);
}

if (!process.env.SOLIDITY_GOOGLE_TRACKING_ID) {
console.warn(
"\n\n SOLIDITY_GOOGLE_TRACKING_ID not set, have you added a .env file based on the example?\n\n"
);
} else {
console.log(`Read SOLIDITY_GOOGLE_TRACKING_ID from .env file`);
}

if (!process.env.SOLIDITY_SENTRY_DSN) {
console.warn(
"\n\n SOLIDITY_SENTRY_DSN not set, have you added a .env file based on the example?\n\n"
);
} else {
console.log(`Read SOLIDITY_SENTRY_DSN from .env file`);
}

const definedConstants =
!process.env.SOLIDITY_GA_SECRET |
!process.env.SOLIDITY_GOOGLE_TRACKING_ID ||
!process.env.SOLIDITY_SENTRY_DSN
? {}
: {
"process.env.SOLIDITY_GA_SECRET": `"${process.env.SOLIDITY_GA_SECRET}"`,
"process.env.SOLIDITY_GOOGLE_TRACKING_ID": `"${process.env.SOLIDITY_GOOGLE_TRACKING_ID}"`,
"process.env.SOLIDITY_SENTRY_DSN": `"${process.env.SOLIDITY_SENTRY_DSN}"`,
};

// Ensure output directories exist
ensureDirExists(tmpDir);

Expand Down Expand Up @@ -131,6 +167,7 @@ async function main() {
loader: {
".md": "text",
},
define: definedConstants,
});

if (warnings.length > 1 || errors.length > 1) {
Expand Down
2 changes: 0 additions & 2 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { warnOnOtherSolidityExtensions } from "./popups/warnOnOtherSolidityExten
import { indexHardhatProjects } from "./setup/indexHardhatProjects";
import { setupCommands } from "./setup/setupCommands";
import { setupExtensionState } from "./setup/setupExtensionState";
import { setupFormatterHook } from "./setup/setupFormatterHook";
import { setupLanguageServerHooks } from "./setup/setupLanguageServerHooks";
import { setupTaskProvider } from "./setup/setupTaskProvider";
import { setupWorkspaceHooks } from "./setup/setupWorkspaceHooks";
Expand All @@ -25,7 +24,6 @@ export async function activate(context: ExtensionContext) {

await indexHardhatProjects(extensionState);

setupFormatterHook(extensionState);
setupLanguageServerHooks(extensionState);
setupTaskProvider(extensionState);
await setupCommands(extensionState);
Expand Down
88 changes: 0 additions & 88 deletions client/src/formatter/forgeFormatter.ts

This file was deleted.

25 changes: 0 additions & 25 deletions client/src/formatter/index.ts

This file was deleted.

94 changes: 0 additions & 94 deletions client/src/formatter/prettierFormatter.ts

This file was deleted.

26 changes: 0 additions & 26 deletions client/src/setup/setupFormatterHook.ts

This file was deleted.

Loading

0 comments on commit b882236

Please sign in to comment.