I'm trying to recreate this from sublime text:
{ "keys": ["ctrl+up"], "command": "scroll_lines", "args": {"amount": 1.0 } },
{ "keys": ["ctrl+down"], "command": "scroll_lines", "args": {"amount": -1.0 } },
Scroll by one line is not currently supported by API, but you can use this plugin which implements it:
https://github.com/callum-ramage/ctrl-dir-scroll
Related
I tried the following to set my custom icon for Electron.Net application (it is a Blazor application). I tried pretty much any absolute path / relative path combination I could think of, nothing helped...
For some reason, the icon (both in main window as in Task bar) keeps using the default icon... I tried pretty much any configuration but nothing seems to help... Maybe it is my MyIcon.ico icon that is at fault here? Does it need to be of specific resolution, or anythig?
Strange is - the splash image is showing... What am I doing wrong here?! (ps: for now I am only trying to build electron for Windows)
Here my electron.manifest:
{
"executable": "MyFirstApp",
"splashscreen": {
"imageFile": "/wwwroot/Images/MySplash.png"
},
"name": "MyApp",
"author": "Me",
"singleInstance": false,
"environment": "Production",
"build": {
"appId": "com.MaApp.app",
"productName": "MyApp",
"copyright": "Copyright © 2020",
"buildVersion": "1.0.18",
"win": {
"icon": "wwwroot/Images/MyIcon.ico"
},
"compression": "maximum",
"directories": {
"output": "../../../bin/Desktop"
},
"extraResources": [
{
"from": "./bin",
"to": "bin",
"filter": [ "**/*" ]
}
],
"files": [
{
"from": "./ElectronHostHook/node_modules",
"to": "ElectronHostHook/node_modules",
"filter": [ "**/*" ]
},
"**/*"
]
}
}
Answer was RELATIVE path should be used from the compilation output directory, as stated here.
Pre-requisite: Firebase and node is setup correctly in the local machine
Requirements:
I only need to click the "Start Debugging (F5)" in VSCode once, then all other setup will be done automatically and I can start debugging.
When I change the code in editor during debugging, the change will be deployed and effective immediately
I can keep start and stop debugging session without worrying about process clean up because it's handled automatically after ending debugging session (Shift-F5)
You need only 2 files. Once they are in place, you can F5 to start debugging and Shift-F5 to stop debugging Firebase Functions.
{project_root}/.vscode/launch.json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "attach",
"name": "Debug",
"port": 9229,
"restart": true,
"skipFiles": ["<node_internals>/**"],
"preLaunchTask": "start firebase emulator",
"postDebugTask": "stop firebase emulator"
}
]
}
{project_root}/.vscode/tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "start firebase emulator",
"type": "shell",
"isBackground": true,
// (1) This autocompiles if there is any code change and effective immediately.
// (2) The single '&' ensures tsc -w (used in run build) will not block the emulator to start
// (3) --inspect-function allows debugger to be attached
"command": "npm --prefix ./functions run build -- -w & firebase emulators:start --inspect-functions",
"presentation": { "reveal": "silent", "close": true },
"problemMatcher": [
{
"pattern": [
{
"regexp": ".",
"file": 1,
"line": 1,
"column": 1,
"message": 1
}
],
"background": {
"activeOnStart": true,
"beginsPattern": { "regexp": "." },
"endsPattern": { "regexp": "." }
}
}
]
},
{
"label": "stop firebase emulator",
"command": "echo ${input:terminate}",
"type": "shell"
}
],
"inputs": [
{
"id": "terminate",
"type": "command",
"command": "workbench.action.tasks.terminate",
"args": "terminateAll"
}
]
}
I am trying to do same things like loggerConfigBuilder.WriteTo.Console(new RenderedCompactJsonFormatter()); in appsettings.json file but i don't know and can't find any notation for it. Do you know how can i use provide this option in appsettings.json? Now it is like
"WriteTo": [
{ "Name": "Console" }
This works for me:
"WriteTo": [
{
"Name": "Console",
"Args": {
"formatter": "Serilog.Formatting.Compact.RenderedCompactJsonFormatter, Serilog.Formatting.Compact"
}
},
]
I can run from command line. But if I try to run in vscode, how to add parameter in launch.json? I am running on .dotnet 2.0
dotnet run --kestrelTransport Libuv
If running from vscode, how should I configure launch.json?
The demo launch.json is attached below.
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/bin/Debug/netcoreapp2.0/Benchmarks.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart",
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}
You can replace
"args": [],
with
"args": ["--kestrelTransport", "Libuv"],
Here is an example of what is happening now:
.class {
}
So when I'm typing .class { SublimeText automatically inserts } (which is correct).
Then I press Enter and get this:
.class {
#CURSOR_POSITION#
}
But what I really want is (attention to the closing bracket):
.class {
#CURSOR_POSITION#
}
I've even seen (ok, it was only once) in some editor special setting for this. Now I start using SublimeText (which is cool!) and I feel that it can be customized in a such way but I'm not quite sure how.
Ok! It's not really hard to do it but it was not simple to know how to do it =)
So my approach is:
Write a simple macro (I've edited the default Enter macro called Add Line in Braces.sublime-macro which lives in ~Data/Packages/Default) and save it with a new name.
I've called it CSS.Add Line in Braces.sublime-macro and put in ~Data/Packages/User.
[
{"command": "insert", "args": {"characters": "\n\n"} },
{"command": "move_to", "args": {"to": "hardbol", "extend": false} },
{"command": "insert", "args": {"characters": "\t"} },
{"command": "move", "args": {"by": "lines", "forward": false} },
{"command": "move_to", "args": {"to": "hardeol", "extend": false} },
{"command": "reindent", "args": {"single_line": true} }
]
Apply it for Enter key in CSS files. For that we need to fo to Preferences > Key Bindings - User (it will open ~Data/Packages/User/Default (YOUR_OPERATING_SYSTEM).sublime-keymap) and paste there the following code:
[
{ "keys": ["enter"], "command": "run_macro_file", "args": {"file": "Packages/User/CSS.Add Line in Braces.sublime-macro"}, "context":
[
{ "key": "selector", "operator": "equal", "operand": "source.css" },
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "\\{$", "match_all": true },
{ "key": "following_text", "operator": "regex_contains", "operand": "^\\}", "match_all": true }
]
}
]
It is copy-pasted from the defult keybinding file with one context addition:
{ "key": "selector", "operator": "equal", "operand": "source.css" }
which tells Sublime to apply it only for CSS ext.
Profit!