Added vscode settings

This commit is contained in:
Kristofers Solo
2022-04-28 20:54:44 +03:00
parent 245c3ca779
commit 837a479d82
25004 changed files with 2499800 additions and 0 deletions

View File

@@ -0,0 +1 @@
*.d.ts

View File

@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Language="en-US" Id="discord-vscode" Version="5.8.0" Publisher="icrawl" />
<DisplayName>Discord Presence</DisplayName>
<Description xml:space="preserve">Update your discord status with a rich presence.</Description>
<Tags>discord,vscode,rich,presence,rich presence,rpc</Tags>
<Categories>Other</Categories>
<GalleryFlags>Public</GalleryFlags>
<Properties>
<Property Id="Microsoft.VisualStudio.Code.Engine" Value="^1.63.1" />
<Property Id="Microsoft.VisualStudio.Code.ExtensionDependencies" Value="" />
<Property Id="Microsoft.VisualStudio.Code.ExtensionPack" Value="" />
<Property Id="Microsoft.VisualStudio.Code.ExtensionKind" Value="ui" />
<Property Id="Microsoft.VisualStudio.Code.LocalizedLanguages" Value="" />
<Property Id="Microsoft.VisualStudio.Services.Links.Source" Value="https://github.com/iCrawl/discord-vscode.git" />
<Property Id="Microsoft.VisualStudio.Services.Links.Getstarted" Value="https://github.com/iCrawl/discord-vscode.git" />
<Property Id="Microsoft.VisualStudio.Services.Links.GitHub" Value="https://github.com/iCrawl/discord-vscode.git" />
<Property Id="Microsoft.VisualStudio.Services.Links.Support" Value="https://github.com/iCrawl/discord-vscode/issues" />
<Property Id="Microsoft.VisualStudio.Services.Links.Learn" Value="https://github.com/iCrawl/discord-vscode#readme" />
<Property Id="Microsoft.VisualStudio.Services.Branding.Color" Value="#6477C1" />
<Property Id="Microsoft.VisualStudio.Services.Branding.Theme" Value="dark" />
<Property Id="Microsoft.VisualStudio.Services.GitHubFlavoredMarkdown" Value="true" />
</Properties>
<License>extension/LICENSE.txt</License>
<Icon>extension/assets/icon.png</Icon>
</Metadata>
<Installation>
<InstallationTarget Id="Microsoft.VisualStudio.Code"/>
</Installation>
<Dependencies/>
<Assets>
<Asset Type="Microsoft.VisualStudio.Code.Manifest" Path="extension/package.json" Addressable="true" />
<Asset Type="Microsoft.VisualStudio.Services.Content.Details" Path="extension/README.md" Addressable="true" />
<Asset Type="Microsoft.VisualStudio.Services.Content.License" Path="extension/LICENSE.txt" Addressable="true" />
<Asset Type="Microsoft.VisualStudio.Services.Icons.Default" Path="extension/assets/icon.png" Addressable="true" />
</Assets>
</PackageManifest>

View File

@@ -0,0 +1,22 @@
MIT License
Copyright (c) 2017-2022 iCrawl
Copyright (c) 2017-2019 Khinenw
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -0,0 +1,70 @@
# Discord Presence
> Update your discord status with a rich presence.
<div align="center">
<p>
<a href="https://marketplace.visualstudio.com/items?itemName=icrawl.discord-vscode">
<img alt="Visual Studio Marketplace Version" src="https://img.shields.io/visual-studio-marketplace/v/icrawl.discord-vscode?label=Visual%20Studio%20Marketplace">
</a>
<a href="https://marketplace.visualstudio.com/items?itemName=icrawl.discord-vscode">
<img alt="Visual Studio Marketplace Downloads" src="https://img.shields.io/visual-studio-marketplace/d/icrawl.discord-vscode">
</a>
<a href="https://marketplace.visualstudio.com/items?itemName=icrawl.discord-vscode">
<img alt="Visual Studio Marketplace Rating" src="https://img.shields.io/visual-studio-marketplace/r/icrawl.discord-vscode">
</a>
</p>
<p>
<a href="https://open-vsx.org/extension/icrawl/discord-vscode">
<img alt="Open VSX Version" src="https://img.shields.io/open-vsx/v/icrawl/discord-vscode?label=OpenVSX%20Marketplace">
</a>
<a href="https://open-vsx.org/extension/icrawl/discord-vscode">
<img alt="Open VSX Downloads" src="https://img.shields.io/open-vsx/dt/icrawl/discord-vscode">
</a>
<a href="https://open-vsx.org/extension/icrawl/discord-vscode">
<img alt="Open VSX Rating" src="https://img.shields.io/open-vsx/rating/icrawl/discord-vscode">
</a>
</p>
<p>
<a href="https://discord.gg/cZSWqAF">
<img src="https://canary.discordapp.com/api/guilds/424963290989461514/embed.png" alt="Discord server">
</a>
</p>
</div>
## Features
- Shows what you are editing in VSCode
- Support for over 140 of the most popular languages
- Enable/Disable Rich Presence for individual workspaces (enabled by default)
- Custom string support
- Stable or Insiders build detection
- Debug mode detection
- Easily manually reconnect to Discord
## Troubleshooting
**Windows:** Do not run your VSCode or Discord as admin, there is no reason to and it just further complicates everything down the line.
**Linux:** Discord versions installed using `flatpak` or `snap` need modifications in order to support IPC. In order to avoid this (and as Discord itself suggests) you should download it from [discord.com](https://discord.com/download)
References:
https://github.com/flathub/com.discordapp.Discord/issues/29
https://github.com/iCrawl/discord-vscode/issues/77#issuecomment-435622205
https://github.com/iCrawl/discord-vscode/issues/85#issuecomment-417895483
## Contributing
1. [Fork the repository](https://github.com/iCrawl/discord-vscode/fork)!
2. Clone your fork: `git clone https://github.com/your-username/discord-vscode.git`
3. Create your feature branch: `git checkout -b my-new-feature`
4. Commit your changes: `git commit -am 'Add some feature'`
5. Push to the branch: `git push origin my-new-feature`
6. Submit a pull request :D
## Author
**Discord Presence** © [iCrawl](https://github.com/iCrawl).
Authored and maintained by iCrawl.
> GitHub [@iCrawl](https://github.com/iCrawl)

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@@ -0,0 +1,22 @@
interface ActivityPayload {
details?: string | undefined;
state?: string | undefined;
startTimestamp?: number | null | undefined;
largeImageKey?: string | undefined;
largeImageText?: string | undefined;
smallImageKey?: string | undefined;
smallImageText?: string | undefined;
partyId?: string | undefined;
partySize?: number | undefined;
partyMax?: number | undefined;
matchSecret?: string | undefined;
joinSecret?: string | undefined;
spectateSecret?: string | undefined;
buttons?: {
label: string;
url: string;
}[] | undefined;
instance?: boolean | undefined;
}
export declare function activity(previous?: ActivityPayload): Promise<ActivityPayload>;
export {};

View File

@@ -0,0 +1,60 @@
export declare const CLIENT_ID: "383226320970055681";
export declare const KNOWN_EXTENSIONS: {
[key: string]: {
image: string;
};
};
export declare const KNOWN_LANGUAGES: {
language: string;
image: string;
}[];
export declare const EMPTY: "";
export declare const FAKE_EMPTY: "";
export declare const FILE_SIZES: readonly [" bytes", "KB", "MB", "GB", "TB"];
export declare const IDLE_IMAGE_KEY: "vscode-big";
export declare const DEBUG_IMAGE_KEY: "debug";
export declare const VSCODE_IMAGE_KEY: "vscode";
export declare const VSCODE_INSIDERS_IMAGE_KEY: "vscode-insiders";
export declare const UNKNOWN_GIT_BRANCH: "Unknown";
export declare const UNKNOWN_GIT_REPO_NAME: "Unknown";
export declare const enum REPLACE_KEYS {
Empty = "{empty}",
FileName = "{file_name}",
DirName = "{dir_name}",
FullDirName = "{full_dir_name}",
Workspace = "{workspace}",
VSCodeWorkspace = "(Workspace)",
WorkspaceFolder = "{workspace_folder}",
WorkspaceAndFolder = "{workspace_and_folder}",
LanguageLowerCase = "{lang}",
LanguageTitleCase = "{Lang}",
LanguageUpperCase = "{LANG}",
TotalLines = "{total_lines}",
CurrentLine = "{current_line}",
CurrentColumn = "{current_column}",
FileSize = "{file_size}",
AppName = "{app_name}",
GitRepoName = "{git_repo_name}",
GitBranch = "{git_branch}"
}
export declare const enum CONFIG_KEYS {
Enabled = "enabled",
DetailsIdling = "detailsIdling",
DetailsEditing = "detailsEditing",
DetailsDebugging = "detailsDebugging",
LowerDetailsIdling = "lowerDetailsIdling",
LowerDetailsEditing = "lowerDetailsEditing",
LowerDetailsDebugging = "lowerDetailsDebugging",
LowerDetailsNoWorkspaceFound = "lowerDetailsNoWorkspaceFound",
LargeImageIdling = "largeImageIdling",
LargeImage = "largeImage",
SmallImage = "smallImage",
SuppressNotifications = "suppressNotifications",
WorkspaceExcludePatterns = "workspaceExcludePatterns",
SwapBigAndSmallImage = "swapBigAndSmallImage",
RemoveDetails = "removeDetails",
RemoveLowerDetails = "removeLowerDetails",
RemoveTimestamp = "removeTimestamp",
RemoveRemoteRepository = "removeRemoteRepository",
IdleTimeout = "idleTimeout"
}

View File

@@ -0,0 +1,4 @@
import { ExtensionContext } from 'vscode';
export declare function cleanUp(): void;
export declare function activate(context: ExtensionContext): Promise<void>;
export declare function deactivate(): void;

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,14 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

View File

@@ -0,0 +1,8 @@
export declare const enum LogLevel {
Trace = "TRACE",
Debug = "DEBUG",
Info = "INFO",
Warn = "WARN",
Error = "ERROR"
}
export declare function log(level: LogLevel, message: string | Error): void;

View File

@@ -0,0 +1,30 @@
import { TextDocument, WorkspaceConfiguration } from 'vscode';
import type { API } from './git';
declare type WorkspaceExtensionConfiguration = WorkspaceConfiguration & {
enabled: boolean;
detailsIdling: string;
detailsEditing: string;
detailsDebugging: string;
lowerDetailsIdling: string;
lowerDetailsEditing: string;
lowerDetailsDebugging: string;
lowerDetailsNoWorkspaceFound: string;
largeImageIdling: string;
largeImage: string;
smallImage: string;
suppressNotifications: boolean;
workspaceExcludePatterns: string[];
swapBigAndSmallImage: boolean;
removeDetails: boolean;
removeLowerDetails: boolean;
removeTimestamp: boolean;
removeRemoteRepository: boolean;
idleTimeout: number;
};
export declare function getConfig(): WorkspaceExtensionConfiguration;
export declare const toLower: (str: string) => string;
export declare const toUpper: (str: string) => string;
export declare const toTitle: (str: string) => string;
export declare function resolveFileIcon(document: TextDocument): string;
export declare function getGit(): Promise<API | null | undefined>;
export {};

View File

@@ -0,0 +1,222 @@
{
"name": "discord-vscode",
"displayName": "Discord Presence",
"version": "5.8.0",
"description": "Update your discord status with a rich presence.",
"private": true,
"author": {
"name": "iCrawl",
"email": "icrawltogo@gmail.com"
},
"contributors": [
{
"name": "Frangu Vlad",
"email": "kingdgrizzle@gmail.com"
}
],
"publisher": "icrawl",
"license": "MIT",
"main": "./dist/extension",
"scripts": {
"build": "npm run lint && webpack --mode production",
"lint": "prettier --check . && eslint src --ext mjs,js,ts",
"format": "prettier --write . && eslint src --ext mjs,js,ts --fix"
},
"activationEvents": [
"*"
],
"extensionKind": [
"ui"
],
"contributes": {
"commands": [
{
"command": "discord.enable",
"title": "Enable Discord Presence in the current workspace",
"category": "Discord Presence"
},
{
"command": "discord.disable",
"title": "Disable Discord Presence in the current workspace",
"category": "Discord Presence"
},
{
"command": "discord.reconnect",
"title": "Reconnect Discord Presence to Discord",
"category": "Discord Presence"
},
{
"command": "discord.disconnect",
"title": "Disconnect Discord Presence from Discord",
"category": "Discord Presence"
}
],
"configuration": [
{
"title": "Discord Presence Configuration",
"type": "object",
"properties": {
"discord.enabled": {
"type": "boolean",
"default": true,
"description": "Controls if the Discord Presence should show across all workspaces"
},
"discord.detailsIdling": {
"type": "string",
"default": "Idling",
"description": "Custom string for the details section of the rich presence when idling\n\t- '{empty}' will be replaced with an empty space."
},
"discord.detailsEditing": {
"type": "string",
"default": "Editing {file_name}",
"description": "Custom string for the details section of the rich presence\n\t- '{empty}' will be replaced with an empty space.\n\t- '{file_name}' will be replaced with the current file name.\n\t- '{dir_name}' will get replaced with the folder name that has the current file.\n\t- '{full_dir_name}' will get replaced with the full directory name without the current file name.\n\t- '{workspace}' will be replaced with the current workspace name, if any.\n\t- '{workspace_folder}' will be replaced with the currently accessed workspace folder, if any.\n\t- '{workspace_and_folder} will be replaced with the currently accessed workspace and workspace folder like this: 'Workspace - WorkspaceFolder'\n\t- '{current_column}' will get replaced with the current column of the current line.\n\t- '{current_line}' will get replaced with the current line number.\n\t- '{total_lines}' will get replaced with the total line number.\n\t- '{file_size}' will get replaced with the current file's size.\n\t- '{git_repo_name}' will be replaced with the active Git repository name (from the git URL)\n\t- '{git_branch}' will be replaced with the current active branch name."
},
"discord.detailsDebugging": {
"type": "string",
"default": "Debugging {file_name}",
"description": "Custom string for the details section of the rich presence when debugging\n\t- '{empty}' will be replaced with an empty space.\n\t- '{file_name}' will be replaced with the current file name.\n\t- '{dir_name}' will get replaced with the folder name that has the current file.\n\t- '{full_dir_name}' will get replaced with the full directory name without the current file name.\n\t- '{workspace}' will be replaced with the current workspace name, if any.\n\t- '{workspace_folder}' will be replaced with the currently accessed workspace folder, if any.\n\t- '{workspace_and_folder} will be replaced with the currently accessed workspace and workspace folder like this: 'Workspace - WorkspaceFolder'\n\t- '{current_column}' will get replaced with the current column of the current line.\n\t- '{current_line}' will get replaced with the current line number.\n\t- '{total_lines}' will get replaced with the total line number.\n\t- '{file_size}' will get replaced with the current file's size.\n\t- '{git_repo_name}' will be replaced with the active Git repository name (from the git URL)\n\t- '{git_branch}' will be replaced with the current active branch name."
},
"discord.lowerDetailsIdling": {
"type": "string",
"default": "Idling",
"description": "Custom string for the state section of the rich presence when idling\n\t- '{empty}' will be replaced with an empty space."
},
"discord.lowerDetailsEditing": {
"type": "string",
"default": "Workspace: {workspace}",
"description": "Custom string for the state section of the rich presence\n\t- '{empty}' will be replaced with an empty space.\n\t- '{file_name}' will be replaced with the current file name.\n\t- '{dir_name}' will get replaced with the folder name that has the current file.\n\t- '{full_dir_name}' will get replaced with the full directory name without the current file name.\n\t- '{workspace}' will be replaced with the current workspace name, if any.\n\t- '{workspace_folder}' will be replaced with the currently accessed workspace folder, if any.\n\t- '{workspace_and_folder} will be replaced with the currently accessed workspace and workspace folder like this: 'Workspace - WorkspaceFolder'\n\t- '{current_column}' will get replaced with the current column of the current line.\n\t- '{current_line}' will get replaced with the current line number.\n\t- '{total_lines}' will get replaced with the total line number.\n\t- '{file_size}' will get replaced with the current file's size.\n\t- '{git_repo_name}' will be replaced with the active Git repository name (from the git URL)\n\t- '{git_branch}' will be replaced with the current active branch name."
},
"discord.lowerDetailsDebugging": {
"type": "string",
"default": "Debugging: {workspace}",
"description": "Custom string for the state section of the rich presence when debugging\n\t- '{empty}' will be replaced with an empty space.\n\t- '{file_name}' will be replaced with the current file name.\n\t- '{dir_name}' will get replaced with the folder name that has the current file.\n\t- '{full_dir_name}' will get replaced with the full directory name without the current file name.\n\t- '{workspace}' will be replaced with the current workspace name, if any.\n\t- '{workspace_folder}' will be replaced with the currently accessed workspace folder, if any.\n\t- '{workspace_and_folder} will be replaced with the currently accessed workspace and workspace folder like this: 'Workspace - WorkspaceFolder'\n\t- '{current_column}' will get replaced with the current column of the current line.\n\t- '{current_line}' will get replaced with the current line number.\n\t- '{total_lines}' will get replaced with the total line number.\n\t- '{file_size}' will get replaced with the current file's size.\n\t- '{git_repo_name}' will be replaced with the active Git repository name (from the git URL)\n\t- '{git_branch}' will be replaced with the current active branch name."
},
"discord.lowerDetailsNoWorkspaceFound": {
"type": "string",
"default": "No workspace",
"description": "Custom string for the state section of the rich presence when no workspace is found.\nIf set to '{empty}', this will be an empty space.\n\t- '{current_line}' will get replaced with the current line number.\n\t- '{total_lines}' will get replaced with the total line number.\n\t- '{file_size}' will get replaced with the current file's size."
},
"discord.largeImageIdling": {
"type": "string",
"default": "Idling",
"description": "Custom string for the largeImageText section of the rich presence when idling"
},
"discord.largeImage": {
"type": "string",
"default": "Editing a {LANG} file",
"description": "Custom string for the largeImageText section of the rich presence.\n\t- '{lang}' will be replaced with the lowercased language ID\n\t- '{LANG}' will be replaced with the uppercased language ID"
},
"discord.smallImage": {
"type": "string",
"default": "{app_name}",
"description": "Custom string for the smallImageText section of the rich presence\n\t- '{app_name}' will get replaced with the current Visual Studio Code version."
},
"discord.suppressNotifications": {
"type": "boolean",
"default": false,
"description": "Decides if error messages are shown to the user"
},
"discord.workspaceExcludePatterns": {
"type": "array",
"items": {
"type": "string"
},
"default": [],
"description": "Patterns of workspaces to ignore"
},
"discord.swapBigAndSmallImage": {
"type": "boolean",
"default": false,
"description": "Swaps the big and small image on the rich presence"
},
"discord.removeDetails": {
"type": "boolean",
"default": false,
"description": "Removes the details"
},
"discord.removeLowerDetails": {
"type": "boolean",
"default": false,
"description": "Removes the lower details"
},
"discord.removeTimestamp": {
"type": "boolean",
"default": false,
"description": "Removes the timestamp"
},
"discord.removeRemoteRepository": {
"type": "boolean",
"default": false,
"description": "Removes the View Repository button"
},
"discord.idleTimeout": {
"type": "number",
"default": 0,
"description": "Time (in seconds) to clear the presence when idling. 0 (the default) means no clearing"
}
}
}
]
},
"repository": {
"type": "git",
"url": "https://github.com/iCrawl/discord-vscode.git"
},
"bugs": {
"url": "https://github.com/iCrawl/discord-vscode/issues"
},
"keywords": [
"discord",
"vscode",
"rich",
"presence",
"rich presence",
"rpc"
],
"categories": [
"Other"
],
"homepage": "https://github.com/iCrawl/discord-vscode#readme",
"icon": "assets/icon.png",
"galleryBanner": {
"color": "#6477C1",
"theme": "dark"
},
"dependencies": {
"bufferutil": "^4.0.6",
"dayjs": "^1.10.7",
"discord-rpc": "^4.0.1",
"lodash-es": "^4.17.21",
"tslib": "^2.3.1",
"utf-8-validate": "^5.0.8"
},
"devDependencies": {
"@types/lodash-es": "^4.17.5",
"@types/node": "^17.0.13",
"@types/vscode": "^1.63.1",
"@typescript-eslint/eslint-plugin": "^5.10.1",
"@typescript-eslint/parser": "^5.10.1",
"clean-webpack-plugin": "^4.0.0",
"eslint": "^8.8.0",
"eslint-config-marine": "^9.3.2",
"eslint-config-prettier": "^8.3.0",
"prettier": "^2.5.1",
"terser-webpack-plugin": "^5.3.0",
"ts-loader": "^9.2.6",
"tsup": "^5.11.13",
"typescript": "^4.5.5",
"webpack": "^5.67.0",
"webpack-cli": "^4.9.2"
},
"engines": {
"vscode": "^1.63.1"
},
"__metadata": {
"id": "2bbe1392-1ad3-4f59-82bc-fccaa3afc3a5",
"publisherId": "5ccbcc66-3677-482b-9f60-f342bfe54f8d",
"publisherDisplayName": "Crawl",
"isPreReleaseVersion": false,
"preRelease": false,
"installedTimestamp": 1643918581304
}
}

View File

@@ -0,0 +1,20 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true
},
"include": [
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.mjs",
"**/*.jsx",
"**/*.test.ts",
"**/*.test.js",
"**/*.test.mjs",
"**/*.spec.ts",
"**/*.spec.js",
"**/*.spec.mjs"
],
"exclude": []
}