My per-project Sublime Text 2 settings seem to not override the global settings.
I added this lines inside "settings" inside my myproj.sublime-project:
"file_exclude_patterns": ["config.xml"]
"folder_exclude_patterns": [".git", ".metadata"]
but that did not prevent those folders/files from showing up on the project sidebar.
None of the files/folders above are mentioned in my global settings.
Is it a known Sublime issue? Am I doing something wrong?
You have to add those settings under folders (example taken from here):
{
"folders":
[
{
"path": "src",
"folder_exclude_patterns": ["backup"]
},
{
"path": "docs",
"name": "Documentation",
"file_exclude_patterns": ["*.css"]
}
]
}
Related
I am trying to change the location of where Serilog files get written to.
It will write to a directory at the root of the project or below (example, StructuredLogs/file-here.txt), but any time I attempt to use an env variable or write to an absolute file path or even relative file path, it will only write to the root directory and replace / or \ (properly escaped) with :
The settings are in the appSettings.json as such:
"Serilog": {
"Using": [],
"Properties": {
"ApplicationName": "Test API"
},
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft": "Debug",
"Microsoft.TestApi": "Debug",
"System": "Debug"
}
},
"Enrich": [ "FromLogContext", "WithMachineName", "WithProcessId", "WithProcessName", "WithThreadId" ],
"WriteTo": [
{ "Name": "Console" },
{
"Name": "File",
"Args": {
"path": "D:\\repo\\micro-services\\Apis\\structured-logs\\logs.txt",
"rollingInterval": "Day",
"outputTemplate": "{Timestamp:G} {Message}{NewLine:1}{Exception:1}"
}
},
{
"Name": "File",
"Args": {
"path": "D:\\repo\\micro-services\\Apis\\structured-logs\\logs.json",
"rollingInterval": "Day",
"formatter": "Serilog.Formatting.Json.JsonFormatter, Serilog"
}
},
...
I have tried:
Moving the solution to my local computer from a portable drive: C:/ vs D:/
Ensuring it was running with elevated permissions of Visual Studio 2022
changing to the various types of ways I could get to a different directory (relative, absolute, env variable, etc.)
forward-slash vs back-slash
none have worked.
Looks vaguely familiar to a character set encoding issue of some sort, but not sure.
Any thoughts as ideally I would have a relative path?
I use these at program.cs
the log file was saved at parent dictionary
Log.Logger = new LoggerConfiguration() .WriteTo.Console() .WriteTo.File("../log-.txt", rollingInterval: RollingInterval.Day) .CreateLogger();
I have followed this guide to set up .eslintrc configuration.
https://github.com/typescript-eslint/typescript-eslint/blob/master/docs/getting-started/linting/README.md
I have also enabled ESLint in Visual Studio by following this guide:
https://stackoverflow.com/a/44458832/3850405
My problem is that I want to use a project specific config instead of the Global ESLint Config.
The guide sets up a .eslintrc.js file so I tried to switch to a file that had the same structure as C:\Users\Oscar\.eslintrc.
Tried placing the .eslintrc in the root folder of the solution, project and in my ClientApp folder but nothing got picked up. Is it possible to use a project specific ESLint config in Visual Studio and receive build errors/warnings?
Running the command npx eslint . --ext .js,.jsx,.ts,.tsx gives me correct errors but Visual Studio shows no errors.
.eslintrc:
{
"root": true,
"parser": "#typescript-eslint/parser",
"plugins": [
"#typescript-eslint",
"jest"
],
"extends": [
"eslint:recommended",
"plugin:#typescript-eslint/recommended",
"plugin:jest/recommended",
"plugin:react/recommended"
],
"env": {
"browser": true,
"node": true,
"jest/globals": true
},
"rules": {
"no-console": [
"error",
{ "allow": [ "warn", "error" ] }
]
}
}
I was able to get ESLint in Visual Studio 2019 to use a configuration file that I had in the root of my project.
The file is called ".eslintrc.json". Here is the contents of the file so far:
{
"extends": "eslint:recommended",
"globals": {
"kendo": "readonly"
},
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"jquery": true
},
"rules": {
"no-prototype-builtins": "off",
"no-unused-vars": [
"error",
{ "args": "none" }
]
}
}
One thing I noticed is that I had close and re-open Visual Studio after adding the file before it would start working. Once I did that changes I made to the file would take effect immediately.
I use Sublime Text 3 as my default text/code editor and I very frequently use the terminal in Sublime Text 3 with the Terminus package. And recently I've discovered git it has a really wonderful bash and I prefer using the git bash instead of using git through the default Windows terminal.
Is there any way that I can do it?
To do this, open the Terminus preferences by choosing Preferences > Package Settings > Terminus > Settings from the menu or Preferences: Terminus Settings from the command palette.
Both will open the Terminus settings in a new split window, with your settings on the right and the defaults on the left. What you need to do is add a shell_configs key to your preferences (the right pane) that includes a new configuration for using Git Bash.
That would look something like this:
"shell_configs":
[
{
"name": "Git Bash",
"cmd": ["cmd.exe", "/k", "C:/Program Files (x86)/Git/bin/bash.exe"],
"env": {},
"enable": true,
"default": false,
"platforms": ["windows"]
},
]
Replace the path to Git Bash as appropriate if it's not installed in the default location. You can also set default to true instead of false if you want to use it by default.
If you add this setting to your preferences as it appears here, then the only shell configuration that will exist will be this one. If you want to still be able to use the other configurations as well, then copy the default value of the setting from the Left pane to the right, and then add yours to the list (remember that all of the settings need to be comma separated).
OdatNurd, thank you for the idea, but cmd.exe opening git bash in separate window. I used your idea and change following settings as bellow to start git bash shell in Terminus Panel, which is appearing in Sublime text. It works for me.
{
"shell_configs":
[
{
"name": "Git Bash",
"cmd": ["C:/Program Files/Git/bin/sh.exe"],
"env": {},
"enable": true,
"default": false,
"platforms": ["windows"]
},
]
}
setup git bash/cmd terminal in sublime text editor
GOTO
preferences>
package settings>
terminus>
settings
{
"default_config" : {
"windows" : "Git Bash"
},
"shell_configs":
[
{
"name": "Git Bash",
"cmd": ["C:/Program Files/Git/bin/sh.exe"],
"env": {},
"enable": true,
"default": false,
"platforms": ["windows"]
}
]
}
Then GOTO
preferences>
package settings>
terminus>
key bindings>
[
{
//alt+1 for cmd
"keys": ["alt+1"],
"command": "terminus_open",
"args" : {
"cmd": "cmd.exe",
"cwd": "${file_path:${folder}}",
"panel_name": "Terminus"
}
},
{
//alt +2 for git bash
"keys": ["alt+2"],
"command": "terminus_open",
"args" : {
"cmd": ["C:/Program Files/Git/bin/sh.exe"],
"cwd": "${file_path:${folder}}",
"panel_name": "Terminus"
}
},
]
While installing the appx now i am able to see logo on launcher/install popup screen.
This worked when i made below changes:
1)Downgraded electron-builder version to: 20.39.0
2)Changed the directories entry in package.json as :
directories:{
"buildResources": "build",
"output": "build"}
3)Created appx named folder inside the build directory and created the build directory at package.json level
4)Added icon named "StoreLogo.png" inside build/appx directory that we have created earlier.
5)add the entry of the same in :
"win": {
"icon":"build/appx/StoreLogo.png"
}
6)After this just create the appx using electron-builder -w appx command
Now I have one more doubt after complete installation i am still seeing the default electron logo at the task-bar and also in the apps & features if i search for my application.
On the launcher/install popup i am able to see the app logo like below hidden with red color:
After installing and launching the app i am still able to see the default electron icon in the taskbar as below highlighted in red:
This is how my package.json build property looks:
{
"build": {
"extraFiles": [
"node_modules/ionic-enterprise-couchbase-lite-electron/**/*"
],
"publish": [
{
"provider": "generic",
"url": "***********"
}
],
"appId": "**************",
"nsis": {
"perMachine": true,
"oneClick": false,
"allowToChangeInstallationDirectory": true
},
"squirrelWindows": {},
"files": [
"electron.js",
"www/**/*",
"build/Square150x150Logo.png",
"build/Square44x44Logo.png"
],
"directories": {
"buildResources": "build",
"output": "build"
},
"appx": {
"identityName": "myApp",
"publisher": "CN=*************************",
"publisherDisplayName": "my Company",
"applicationId": "myApp",
"displayName": "myApp",
"backgroundColor": "#f2f4f7"
},
"win": {
"certificateFile": "./certs/CordovaApp.Windows10_StoreKey.pfx",
"publisherName": "my Company",
"icon": "build/appx/StoreLogo.png",
"target": [
{
"target": "nsis",
"arch": [
"ia32"
]
},
"appx",
"msi"
]
},
"nodeGypRebuild": "false",
"npmRebuild": "false"
}
}
I tried adding all related resources as mentioned in : https://www.electron.build/configuration/appx but it started giving error of invalid manifest when creating a appx.
So can anyone please help me to resolve this issue?
I solved the issue by doing below changes:
1) Added the assets mentioned in the appx link: https://www.electron.build/configuration/appx
2) created appx folder in the build directory, keep the package.json as mentioned above.
3)Make sure the app logos named should be specific as metioned in the link .PNG format.
4)Earlier I had icon names as e.g: Square44x44Logo.png format .PNG then after changing the name to Square44x44Logo kept format .PNG as it is I was able to solve installed app issue.
What i realized by this is naming convention does matter a lot in case of applying icons. So the main issue caused due to pont 4.
I have a SublimeText3 project which I use to show particular folders in the sidebar. This works, however subdirectories of the folders in folder_include_pattern are not visible in the project (they're obviously there if I open the project as a folder instead).
node_modules
my-module
('test' should be here but is not shown)
my-other-module
('test' should be here but is not shown)
Here is my .project file:
{
"folders": [
{
"path": "node_modules",
"folder_include_patterns": [
"my-module",
"my-other-module"
]
},
{
"path": "."
}
]
}
How can I show all the subdirs of the directories in folder_include_patterns?
Solved it: subdir names must also be in folder_include_patterns. Eg, to include /node_modules/my-module/test, I needed:
{
"folders": [
{
"path": "node_modules",
"folder_include_patterns": [
"my-module",
"my-other-module",
"test"
]
},
{
"path": "."
}
]
}
2018 updae: note if you're reading this in 2018, and want to do this for node_modules, the best way to handle monorepos (where you have some of your own modules included in the project) is via yarn workspaces