Skip to content
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

update logo and title #311

Merged
merged 4 commits into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!--

Thank you for using **Hardhat for Visual Studio Code** and taking the time to open an issue!
Thank you for using **Solidity for Visual Studio Code by Nomic Foundation** and taking the time to open an issue!

**Note that this issue tracker is not a support channel.**

- For help with **Hardhat for Visual Studio Code**, please use our [Discord server](https://hardhat.org/discord).
- For help with **Solidity for Visual Studio Code by Nomic Foundation**, please use our [Discord server](https://hardhat.org/discord).

If you are reporting a bug, please include reproduction steps. The best way to do this is to include a [Minimal Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example). If you can't do that, then include a link to your repo, and the steps to reproduce the problem. The easier it is to reproduce your problem, the faster we are going to be able to fix it.

Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!--
Thank you for using **Hardhat for Visual Studio Code** and taking the time to send a Pull Request!
Thank you for using **Solidity for Visual Studio Code by Nomic Foundation** and taking the time to send a Pull Request!

If you are introducing a new feature, please discuss it in an Issue or with someone from the team before submitting your change.

Expand Down
2 changes: 1 addition & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ client/package.json
server/package.json

**/docs
!**/docs/images/hardhat-vscode-logo.png
!**/docs/images/vscode-logo.png

!server/node_modules/@nomicfoundation/solidity-analyzer/package.json
!server/node_modules/@nomicfoundation/solidity-analyzer/index.js
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Removed

- Remove unnecessary setting for turning off formatting, use vscode formatting config if you want to turn **Hardhat for Visual Studio Code** formatting off ([#102](https://github.com/NomicFoundation/hardhat-vscode/issues/102))
- Remove unnecessary setting for turning off formatting, use vscode formatting config if you want to turn formatting off ([#102](https://github.com/NomicFoundation/hardhat-vscode/issues/102))

### Fixed

Expand Down
12 changes: 6 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# How to contribute to Hardhat for Visual Studio Code
# How to contribute to Solidity for Visual Studio Code by Nomic Foundation

This document contains details on how to collaborate and develop on the **Hardhat for Visual Studio Code** project.
This document contains details on how to collaborate and develop on the **Solidity for VS Code by Nomic Foundation** project.

- [How to contribute to Hardhat for Visual Studio Code](#how-to-contribute-to-hardhat-for-visual-studio-code)
- [How to contribute to Solidity for Visual Studio Code by Nomic Foundation](#how-to-contribute-to-solidity-for-visual-studio-code-by-nomic-foundation)
- [Project structure](#project-structure)
- [Installing](#installing)
- [Running Locally](#running-locally)
Expand All @@ -23,7 +23,7 @@ This document contains details on how to collaborate and develop on the **Hardha

## Project structure

**Hardhat for Visual Studio Code** is a typescript vscode extension and language server. The code is organised into:
The vscode extension and language server are written in typescript. The code is organised into:

- `./client` - the vscode extension, which mainly delegates onto the language server for functionality
- `./server` - the Hardhat language server, which supports the validation, quickfixes and other solidity language features of the extension
Expand All @@ -33,7 +33,7 @@ This document contains details on how to collaborate and develop on the **Hardha

## Installing

[node](https://nodejs.org/en/) and [yarn](https://yarnpkg.com/) are required for **Hardhat for Visual Studio Code** development.
[node](https://nodejs.org/en/) and [yarn](https://yarnpkg.com/) are required for development.

To install the project's dependencies, run `yarn` in the root directory of the repository. This will install node dependencies at the top level, and in both the `./server` and `./client` package directories.

Expand Down Expand Up @@ -88,7 +88,7 @@ To do this, you need:

## Testing

**Hardhat for Visual Studio Code** has unit, protocol and e2e tests. Components of the server should be tested with unit tests, with a small set of integration tests providing confidence that component interactions work.
The project has unit, protocol and e2e tests. Components of the server should be tested with unit tests, with a small set of integration tests providing confidence that component interactions work.

A complete test run involves both test suites and can be run, from repo root, with:

Expand Down
18 changes: 9 additions & 9 deletions EXTENSION.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Hardhat for Visual Studio Code
# Solidity by Nomic Foundation

This extension adds language support for [Solidity](https://soliditylang.org/) to Visual Studio Code, and provides editor integration for [Hardhat projects](https://hardhat.org/). Integrations for other tools are coming in the near future. It supports:

Expand Down Expand Up @@ -34,15 +34,15 @@ Built by the [Nomic Foundation](https://nomic.foundation/). [We’re hiring](htt

## Installation

**Hardhat for Visual Studio Code** can be installed by [using the Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=NomicFoundation.hardhat-solidity).
**Solidity by Nomic Foundation** can be installed by [using the Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=NomicFoundation.hardhat-solidity).

Some features (e.g. inline validation, quick fixes) are still experimental and are only enabled within a [Hardhat](https://hardhat.org/) project, this is a limitation that will be lifted with future releases.

## Features

### Code Completions

**Hardhat for Visual Studio Code** autocompletes references to existing symbols (e.g. contract instances, globally available variables and built-in types like arrays) and import directives (i.e. it autocompletes the path to the imported file).
**Solidity by Nomic Foundation** autocompletes references to existing symbols (e.g. contract instances, globally available variables and built-in types like arrays) and import directives (i.e. it autocompletes the path to the imported file).

Direct imports (those not starting with `./` or `../`) are completed based on suggestions from `./node_modules`.

Expand Down Expand Up @@ -100,7 +100,7 @@ Hovering the cursor over variables, function calls, errors and events will displ

### Inline code validation (Diagnostics)

As code is edited, **Hardhat for Visual Studio Code** runs the [solc](https://docs.soliditylang.org/en/latest/using-the-compiler.html) compiler over the changes and displays any warnings or errors it finds.
As code is edited, **Solidity by Nomic Foundation** runs the [solc](https://docs.soliditylang.org/en/latest/using-the-compiler.html) compiler over the changes and displays any warnings or errors it finds.

This feature is only available in solidity files that are part of a **Hardhat** project, as **Hardhat** is used for import resolution, see [Hardhat Projects](#hardhat-projects) for details.

Expand Down Expand Up @@ -192,27 +192,27 @@ This extension should work without any configuration. If formatting functionalit

## Hardhat Projects

**Hardhat for Visual Studio Code** provides enhanced functionality for Solidity files within a **Hardhat** project, including inline validation and quick fixes.
**Solidity by Nomic Foundation** provides enhanced functionality for Solidity files within a **Hardhat** project, including inline validation and quick fixes.

To take advantage of these features, use the `File` menu to `Open Folder`, and select the folder containing the `hardhat.config.{js,ts}` file.

Inline validation (the display of compiler errors and warnings against the code) is based on your Hardhat configuration file. The version of the `solc` solidity compiler used for validation is set within this file, see the [Hardhat documentation](https://hardhat.org/config/#solidity-configuration) for more details.

### Monorepo Support

**Hardhat for Visual Studio Code** will detect Hardhat projects (folders containing a `hardhat.config.{js,ts}` file) within a monorepo, when the root of the monorepo is opened as a workspace folder.
**Solidity by Nomic Foundation** will detect Hardhat projects (folders containing a `hardhat.config.{js,ts}` file) within a monorepo, when the root of the monorepo is opened as a workspace folder.

The **Hardhat config file** that is used when validating a Solidity file is shown in the Solidity section on the _Status Bar_:

![Open Config](https://raw.githubusercontent.com/NomicFoundation/hardhat-vscode/main/docs/gifs/open-config.gif "Open Config")

## Formatting

**Hardhat for Visual Studio Code** provides formatting support for `.sol` files, by leveraging [prettier-plugin-solidity](https://github.com/prettier-solidity/prettier-plugin-solidity).
**Solidity by Nomic Foundation** provides formatting support for `.sol` files, by leveraging [prettier-plugin-solidity](https://github.com/prettier-solidity/prettier-plugin-solidity).

> **Note:** if you currently have other solidity extensions installed, or have had previously, they may be set as your default formatter for solidity files.

To set **Hardhat for Visual Studio Code** as your default formatter for solidity files:
To set **Solidity by Nomic Foundation** as your default formatter for solidity files:

1. Within a Solidity file run the _Format Document With_ command, either through the **command palette**, or by right clicking and selecting through the context menu:

Expand All @@ -222,7 +222,7 @@ To set **Hardhat for Visual Studio Code** as your default formatter for solidity

![Format Document With](https://raw.githubusercontent.com/NomicFoundation/hardhat-vscode/main/docs/images/configure_default_formatter.png "Configure default formatter")

3. Select `Solidity + Hardhat` as the default formatter for solidity files
3. Select `Solidity` as the default formatter for solidity files

![Format Document With](https://raw.githubusercontent.com/NomicFoundation/hardhat-vscode/main/docs/images/select_solidity_plus_hardhat.png "Confiure default formatter")

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hardhat for Visual Studio Code
# Solidity for Visual Studio Code by Nomic Foundation

**Hardhat for Visual Studio Code** is a [Visual Studio Code](https://code.visualstudio.com/) extension that provides enhanced [Solidity language](https://soliditylang.org/) features.
**Solidity for VS Code by Nomic Foundation** is a [Visual Studio Code](https://code.visualstudio.com/) extension that provides enhanced [Solidity language](https://soliditylang.org/) features.

Built by the [Nomic Foundation](https://nomic.foundation/) for the Ethereum community.

Expand All @@ -22,13 +22,13 @@ Join our [Hardhat Support Discord server](https://hardhat.org/discord) to stay u

## Installation

**Hardhat for Visual Studio Code** can be installed by [using the Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=NomicFoundation.hardhat-solidity).
**Solidity for VS Code by Nomic Foundation** can be installed by [using the Visual Studio Code Marketplace](https://marketplace.visualstudio.com/items?itemName=NomicFoundation.hardhat-solidity).

## Contributing

Contributions are always welcome! Feel free to [open any issue](https://github.com/NomicFoundation/hardhat-vscode/issues) or send a pull request.

Go to [CONTRIBUTING.md](./CONTRIBUTING.md) to learn about how to set up **Hardhat for Visual Studio Code**'s development environment.
Go to [CONTRIBUTING.md](./CONTRIBUTING.md) to learn about how to set up the extension's development environment.

## Feedback, help and news

Expand Down
4 changes: 2 additions & 2 deletions client/src/commands/CleanCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import HardhatTaskCommand from "./HardhatTaskCommand";

export default class CleanCommand extends HardhatTaskCommand {
public name(): string {
return "clean";
return "solidity.hardhat.clean";
}

public hardhatArgs(): string[] {
return [this.name()];
return ["clean"];
}

public progressLabel(): string {
Expand Down
4 changes: 2 additions & 2 deletions client/src/commands/CompileCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import HardhatTaskCommand from "./HardhatTaskCommand";

export default class CompileCommand extends HardhatTaskCommand {
public name(): string {
return "compile";
return "solidity.hardhat.compile";
}

public hardhatArgs(): string[] {
return [this.name()];
return ["compile"];
}

public progressLabel(): string {
Expand Down
2 changes: 1 addition & 1 deletion client/src/commands/FlattenCurrentFileCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default class FlattenCurrentFileCommand extends HardhatTaskCommand {
private buffer: string[] = [];

public name(): string {
return "flattenCurrentFile";
return "solidity.hardhat.flattenCurrentFile";
}

public hardhatArgs(): string[] {
Expand Down
2 changes: 1 addition & 1 deletion client/src/commands/HardhatTaskCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default abstract class HardhatTaskCommand extends Command {
if (exitStatus !== 0) {
this.state.outputChannel.show();
await vscode.window.showErrorMessage(
"Hardhat command errored, please see output logs."
"Solidity command errored, please see output logs."
);
}
}
Expand Down
8 changes: 4 additions & 4 deletions client/src/commands/InsertSemicolonCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import vscode, { Position } from "vscode";
import Command from "./Command";

export default class InsertSemicolonCommand extends Command {
public name(): string {
return "solidity.insertSemicolon";
}

public async execute(position: Position) {
const editor = vscode.window.activeTextEditor;

Expand All @@ -19,8 +23,4 @@ export default class InsertSemicolonCommand extends Command {
builder.insert(new Position(position.line, lineText.length), ";")
);
}

public name(): string {
return "insertSemicolon";
}
}
2 changes: 1 addition & 1 deletion client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export async function activate(context: ExtensionContext) {

const { logger } = extensionState;

logger.info("Hardhat for Visual Studio Code Starting ...");
logger.info("Solidity by Nomic Foundation Starting ...");
logger.info(`env: ${extensionState.env}`);

await indexHardhatProjects(extensionState);
Expand Down
2 changes: 1 addition & 1 deletion client/src/formatter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export async function formatDocument(
): Promise<vscode.TextEdit[]> {
try {
const formatter = vscode.workspace
.getConfiguration("hardhat")
.getConfiguration("solidity")
.get("formatter");

switch (formatter) {
Expand Down
4 changes: 2 additions & 2 deletions client/src/popups/showAnalyticsAllowPopup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ export async function showAnalyticsAllowPopup({
}

const item = await window.showInformationMessage(
"Help us improve the Hardhat for Visual Studio Code extension with anonymous crash reports & basic usage data?",
"Help us improve the Solidity by Nomic Foundation extension with anonymous crash reports & basic usage data?",
{ modal: true },
"Accept",
"Decline"
);

const isAccepted = item === "Accept" ? true : false;

const config = workspace.getConfiguration("hardhat");
const config = workspace.getConfiguration("solidity");

await config.update("telemetry", isAccepted, ConfigurationTarget.Global);

Expand Down
4 changes: 3 additions & 1 deletion client/src/setup/setupCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ const commandClasses: ICommandClass[] = [
export async function setupCommands(state: ExtensionState) {
for (const commandClass of commandClasses) {
const command = new commandClass(state);

const disposable = vscode.commands.registerCommand(
`hardhat.solidity.${command.name()}`,
command.name(),
(...args) => command.execute(...args)
);

state.context.subscriptions.push(disposable);
}
}
6 changes: 3 additions & 3 deletions client/src/setup/setupExtensionState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ export function setupExtensionState(
path.join("server", "out", "index.js")
);

const outputChannel: OutputChannel = window.createOutputChannel("Hardhat");
const outputChannel: OutputChannel = window.createOutputChannel("Solidity");
const commandsOutputChannel: OutputChannel =
window.createOutputChannel("Hardhat Commands");
window.createOutputChannel("Solidity Commands");
const telemetry = new SentryClientTelemetry(sentryDsn);
const logger = new Logger(outputChannel, telemetry);

Expand All @@ -40,7 +40,7 @@ export function setupExtensionState(
listenerDisposables: [],
projectsValidationStatus: {},
hardhatTelemetryEnabled:
workspace.getConfiguration("hardhat").get<boolean>("telemetry") ?? false,
workspace.getConfiguration("solidity").get<boolean>("telemetry") ?? false,
globalTelemetryEnabled: env.isTelemetryEnabled,
projectStatusItems: [],

Expand Down
10 changes: 5 additions & 5 deletions client/src/setup/setupLanguageServerHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const startLanguageServer = (extensionState: ExtensionState): void => {
workspace.createFileSystemWatcher("**/*.sol"),
],
},
diagnosticCollectionName: "hardhat-language-server",
diagnosticCollectionName: "solidity-language-server",
outputChannel: extensionState.outputChannel,
initializationOptions: {
extensionName: extensionState.name,
Expand All @@ -67,8 +67,8 @@ const startLanguageServer = (extensionState: ExtensionState): void => {
// Create the language client and start the client.
// Start the client. This will also launch the server
const client = new LanguageClient(
"hardhat-language-server",
"Hardhat Language Server",
"solidity-language-server",
"Solidity Language Server",
serverOptions,
clientOptions
);
Expand All @@ -91,12 +91,12 @@ const startLanguageServer = (extensionState: ExtensionState): void => {

const hardhatTelemetryChangeDisposable = workspace.onDidChangeConfiguration(
(e) => {
if (!e.affectsConfiguration("hardhat.telemetry")) {
if (!e.affectsConfiguration("solidity.telemetry")) {
return;
}

extensionState.hardhatTelemetryEnabled =
workspace.getConfiguration("hardhat").get<boolean>("telemetry") ??
workspace.getConfiguration("solidity").get<boolean>("telemetry") ??
false;

client.sendNotification("custom/didChangeHardhatTelemetryEnabled", {
Expand Down
3 changes: 3 additions & 0 deletions client/src/setup/setupTaskProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { ExtensionState } from "../types";

export function setupTaskProvider(state: ExtensionState) {
const taskProvider = new HardhatTaskProvider(state);

const disposable = vscode.tasks.registerTaskProvider("hardhat", taskProvider);

state.context.subscriptions.push(disposable);

return disposable;
}
2 changes: 1 addition & 1 deletion client/src/setup/setupWorkspaceHooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function onDidOpenTextDocument(state: ExtensionState) {

await vscode.commands.executeCommand(
"setContext",
"hardhat.inHardhatProject",
"solidity.inHardhatProject",
folder !== undefined
);
};
Expand Down
1 change: 1 addition & 0 deletions client/src/taskProvider/HardhatTaskProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ export class HardhatTaskProvider implements vscode.TaskProvider {
tasks.push(task);
}
}

return tasks;
}
}
Binary file removed docs/images/hardhat-vscode-logo.png
Binary file not shown.
Binary file added docs/images/vscode-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading