Skip to content

Commit

Permalink
Merge pull request #2343 from opral/improve-sherlock-appearance-vscode
Browse files Browse the repository at this point in the history
Improve sherlock appearance vscode & add auto migration script
  • Loading branch information
felixhaeberle authored Mar 11, 2024
2 parents b5f2224 + 7b380e7 commit 68d64e3
Show file tree
Hide file tree
Showing 22 changed files with 100 additions and 62 deletions.
5 changes: 5 additions & 0 deletions .changeset/old-paws-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vs-code-extension": minor
---

update variables to branding under the hood
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 24 additions & 24 deletions inlang/source-code/ide-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,63 +31,63 @@
"viewsContainers": {
"activitybar": [
{
"id": "inlang",
"title": "Inlang",
"id": "sherlock",
"title": "Sherlock – i18n inspector",
"icon": "assets/sherlock-vscode-logo.svg"
}
]
},
"views": {
"inlang": [
"sherlock": [
{
"when": "inlang:showRecommendationBanner && inlang:hasProjectInWorkspace",
"when": "sherlock:showRecommendationBanner && sherlock:hasProjectInWorkspace",
"id": "recommendationBanner",
"name": "Recommendation",
"type": "webview",
"group": "inlang@1"
"group": "sherlock@1"
},
{
"when": "!inlang:hasProjectInWorkspace",
"when": "!sherlock:hasProjectInWorkspace",
"id": "gettingStartedView",
"name": "Getting Started",
"type": "webview",
"group": "inlang@2"
"group": "sherlock@2"
},
{
"when": "inlang:hasProjectInWorkspace",
"when": "sherlock:hasProjectInWorkspace",
"id": "projectView",
"name": "Projects",
"type": "tree",
"group": "inlang@3"
"group": "sherlock@3"
},
{
"when": "inlang:hasProjectInWorkspace",
"when": "sherlock:hasProjectInWorkspace",
"id": "messageView",
"name": "Messages",
"type": "webview",
"group": "inlang@4"
"group": "sherlock@4"
},
{
"when": "inlang:hasProjectInWorkspace",
"when": "sherlock:hasProjectInWorkspace",
"id": "errorView",
"name": "Errors",
"type": "tree",
"group": "inlang@5"
"group": "sherlock@5"
}
]
},
"commands": [
{
"command": "inlang.openProject",
"command": "sherlock.openProject",
"title": "Open project"
},
{
"command": "inlang.openSettingsFile",
"command": "sherlock.openSettingsFile",
"title": "Open settings file",
"icon": "$(go-to-file)"
},
{
"command": "inlang.copyError",
"command": "sherlock.copyError",
"title": "Copy Error",
"icon": "$(copy)"
}
Expand All @@ -96,40 +96,40 @@
"view/item/context": [
{
"when": "view == projectView && viewItem == projectViewNode",
"command": "inlang.openProject",
"command": "sherlock.openProject",
"group": "navigation"
},
{
"when": "view == projectView && viewItem == projectViewNode",
"command": "inlang.openSettingsFile",
"command": "sherlock.openSettingsFile",
"group": "inline"
},
{
"when": "view == errorView && viewItem == errorNode",
"command": "inlang.copyError",
"command": "sherlock.copyError",
"group": "inline"
}
]
},
"configuration": {
"properties": {
"inlang.userId": {
"sherlock.userId": {
"type": "string",
"default": ""
},
"inlang.disableRecommendation": {
"sherlock.disableRecommendation": {
"type": "array",
"default": []
},
"inlang.disableConfigFileCreation": {
"sherlock.disableConfigFileCreation": {
"type": "array",
"default": []
},
"inlang.disableConfigFileDeletion": {
"sherlock.disableConfigFileDeletion": {
"type": "array",
"default": []
},
"inlang.previewLanguageTag": {
"sherlock.previewLanguageTag": {
"type": "string",
"default": ""
}
Expand Down
2 changes: 1 addition & 1 deletion inlang/source-code/ide-extension/src/commands/copyError.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { ErrorNode } from "../utilities/errors/errors.js"
import { msg } from "../utilities/messages/msg.js"

export const copyErrorCommand = {
command: "inlang.copyError",
command: "sherlock.copyError",
title: "Inlang: Copy error",
register: vscode.commands.registerCommand,
callback: async (error: ErrorNode) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { getPatternFromString, getStringFromPattern } from "../utilities/message
import { CONFIGURATION } from "../configuration.js"

export const editMessageCommand = {
command: "inlang.editMessage",
command: "sherlock.editMessage",
title: "Inlang: Edit a Message",
register: commands.registerCommand,
callback: async function ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { isQuoted, stripQuotes } from "../utilities/messages/isQuoted.js"
* Helps the user to extract messages from the active text editor.
*/
export const extractMessageCommand = {
command: "inlang.extractMessage",
command: "sherlock.extractMessage",
title: "Inlang: Extract Message",
register: commands.registerTextEditorCommand,
callback: async function (textEditor: TextEditor) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { Message } from "@inlang/sdk"
import * as vscode from "vscode"

export const jumpToPositionCommand = {
command: "inlang.jumpToPosition",
command: "sherlock.jumpToPosition",
title: "Inlang: Jump to position in editor",
register: commands.registerCommand,
callback: async function (args: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CONFIGURATION } from "../configuration.js"
import { getGitOrigin } from "../utilities/settings/getGitOrigin.js"

export const openInEditorCommand = {
command: "inlang.openInEditor",
command: "sherlock.openInEditor",
title: "Inlang: Open in Editor",
register: commands.registerCommand,
callback: async function (args: { messageId: Message["id"]; selectedProjectPath: string }) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { handleTreeSelection, type ProjectViewNode } from "../utilities/project/
import type { NodeishFilesystem } from "@lix-js/fs"

export const openProjectCommand = {
command: "inlang.openProject",
command: "sherlock.openProject",
title: "Inlang: Open project",
register: vscode.commands.registerCommand,
callback: async (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type ProjectViewNode } from "../utilities/project/project.js"
import * as path from "node:path"

export const openSettingsFileCommand = {
command: "inlang.openSettingsFile",
command: "sherlock.openSettingsFile",
title: "Inlang: Open settings file",
register: vscode.commands.registerCommand,
callback: async (node: ProjectViewNode) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("previewLanguageTagCommand", () => {
})

it("should register the command", () => {
expect(previewLanguageTagCommand.command).toBe("inlang.previewLanguageTag")
expect(previewLanguageTagCommand.command).toBe("sherlock.previewLanguageTag")
expect(previewLanguageTagCommand.title).toBe("Inlang: Change preview language tag")
expect(previewLanguageTagCommand.register).toBe(vscode.commands.registerCommand)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { state } from "../utilities/state.js"
import { CONFIGURATION } from "../configuration.js"

export const previewLanguageTagCommand = {
command: "inlang.previewLanguageTag",
command: "sherlock.previewLanguageTag",
title: "Inlang: Change preview language tag",
register: vscode.commands.registerCommand,
callback: async () => {
Expand Down
8 changes: 4 additions & 4 deletions inlang/source-code/ide-extension/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
//initErrorMonitoring()

try {
vscode.commands.executeCommand("setContext", "inlang:hasProjectInWorkspace", false)
vscode.commands.executeCommand("setContext", "inlang:showRecommendationBanner", false)
vscode.commands.executeCommand("setContext", "sherlock:hasProjectInWorkspace", false)
vscode.commands.executeCommand("setContext", "sherlock:showRecommendationBanner", false)
const workspaceFolder = vscode.workspace.workspaceFolders?.[0]

if (!workspaceFolder) {
Expand Down Expand Up @@ -56,7 +56,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
}

await main({ context, workspaceFolder, nodeishFs })
msg("inlang's extension activated", "info")
msg("Sherlock activated", "info")
} catch (error) {
handleError(error)
}
Expand All @@ -81,7 +81,7 @@ async function main(args: {
closestProjectToWorkspace?.projectPath || state().projectsInWorkspace[0]?.projectPath || "",
})

vscode.commands.executeCommand("setContext", "inlang:hasProjectInWorkspace", true)
vscode.commands.executeCommand("setContext", "sherlock:hasProjectInWorkspace", true)

await recommendationBannerView(args)
await projectView(args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function getTreeItem(element: ErrorNode): vscode.TreeItem {
if (element.error) {
treeItem.contextValue = "errorNode"
treeItem.command = {
command: "inlang.copyError",
command: "sherlock.copyError",
title: "Copy Error",
arguments: [element],
}
Expand Down
Loading

0 comments on commit 68d64e3

Please sign in to comment.