I just upgraded to the linux 3080 version, and the build stuff changes seems like a terrible regression for me.
I used to be able to do ctrl-B to build and ctrl-shift-b to upload and run the results (it flashes to a uC).
Now with ctrl-shift-b I have to select the build sub-type from a popup, and then when I want to do a regular build again I have to do ctrl-shift-b first to select the build as with ctrl-B it will just try to upload again. (I thought I read that the selected build was not supposed to set the last sub-build type).
This is a real pain and really upsets my workflow.
As someone who has been writing custom build systems, this frustrates me greatly⌠If the build system are going to stay this way it could be great to be able override and define keystrokes for specific build variants in our sublime-build filesâŚ
Iâm not sure if this shows a panel with all build systems that have a Run variant and if it prioritizes the Run variant of the âcurrently selectedâ build system, but you can even provide the exact path to a build system to the build command:
As I understand, âmakeâ build system is only shown if there is a makefile in the folder open in sidebar. At least that is how it works for me. Wouldnât it be more reasonable to check the directory of the current file first? And only if there is no makefile in the directory of current file, then check the sidebar. This would work even if there is nothing in the sidebar. Or is there a way to enable such behavior?
Does anyone know how it works in 2083 right now? Because I am struggling to get it to do the right thing. (p.s. I am not an expert st3 customizer so I am probably just doing it wrong.)
My TypeScript.sublime-build file lives in âŚ/Packages/User and contains:
{
âcmdâ: â/usr/local/bin/tscâ],
âfile_regexâ: â^(.+?) \((\d+),(\d+)\): (.+)$â,
âselectorâ: âsource.TypeScriptâ
}
When I edit a .ts file the syntax highlighting is for TypeScript and that is also what is displayed in the bottom right corner.
When I choose the TypeScript build system by hand it does the right thing, however
When I have âautomaticâ it doesnât change when I open a .ts file or change to a .ts window.
You must use the scope name for the selector argument.
To get it, open a TypeScript file, open the console and type:
>>> view.scope_name(0)
'source.python keyword.control.import.python '
this example show a Python file. You must use the global scope (âsource.pythonâ here).
Unfortunately, none of this makes any sense to me. Well, I mean it does, but nothing Iâve tried seems to work properly [1], and this thread is both incomplete and confusing at best. Are there any good, complete, real-world examples I can look at?
Specifically, I need something with mixed filetypes (e.g. .java and .py [2]), but where I donât have a recognizable build system (e.g. make).
My use case is that I donât want to have to constantly flip back to the âmainâ file tab in a project in order to be able to build; Iâd like to just hit CTRL+B regardless of which file Iâm editing, and get The Right Thing for that project.
Iâm on Build 3094, Win7 x64.
P.S. I could probably use make, or even just a specifically-named script, but thatâs friction I donât want. My âprojectsâ are very small, usually only 2-5 files, but Iâm frequently switching projects, and creating new ones, and having to include another file in each project is unwanted overhead, particularly when it would only be used for the custom build system (same for custom build commands in a .sublime-project file).
[1] Custom variant with a specific keybind (âNo build systemâ); Use file_patterns keyword (âinit() got an unexpected keyword argument âfile_patternsââ); Custom variant with CTRL+SHIFT+B (trouble with scope/file selector, I guess - simply doesnât work).
I am new to Sublime. I am on a Mac and coming from TextMate because of multiple platform support. I would prefer the selector could have the option to be by file extension instead of a system defined application. I have a lot of special file extensions that I use for different purposes. I am also a mainframe developer so a little different I guess.
Some of my file extensions are JCL, COB, ASM, ACM, ASR, and about 5 or so more. But I also have some common ones such as C and SH
Iâm probably misunderstood something.
I declared my build systems as part of sublime-project file: { "build_systems": [ { "name": "build", "working_dir": "${project_path:${folder}}/v8", "shell_cmd": "gn gen out/Release && ninja -C out/Release -j1000", "file_regex": "^(?:\\.\\.\\/)*(.*):([0-9]*):([0-9]*): error", } ] }
Before Sublime update around one month ago it worked awesome but currently it just doesnât add any output into build output without any error. When I run default C++ build system it add output correctly. What I am doing wrong?
I found that problem is in setting working_dir, if I remove working_dir then output works good. How can I specify wroking_dir for build system?
This is an old thread, but still Iâm seem to be stuck with this.
I work with different languages all the time, and I would like to select associate an existing build system for each language. I might be completely missing something, but I cannot find how to do this (or if this is even possible).
This is probably mentioned at some point above, but to provide some salient points as a synopsis:
All files that you edit have a syntax definition of some sort thatâs used to drive all of the various editing features in Sublime; the type of the file as Sublime sees it is listed in the bottom right of the window in the status bar (for example a new blank tab will say Plain Text)
One of the keys that can appear in a build system (sublime-build file) is selector, which is used to tell Sublime what type of file the build generally applies to, if it should be specific to a certain type of file (which is generally the case).
In the Tools > Build System menu you have the option to select an explicit build system that specifies exactly what build will be used (i.e. what tool to execute) whenever the build functionality is engaged.
The first option in Tools > Build System is Automatic; if you select this then every time you execute a build, Sublime will check to see which of the builds it knows about applies to the current situation and it will use that one.
So, in the general case you just need to set Tools > Build System to Automatic and then every time you use Tools > Build or hit the associated key, the build that applies to the file youâre currently editing will be automatically selected and executed.
For this to work, the build file needs to contain a selector key that gives Sublime the hint as to the type of file it applies to, and all build systems that ship with Sublime contain such a key. If youâre making your own builds, then you need to add such a key yourself to your build.
To do so, open the type of file that the build is supposed to apply to and choose Tools > Developer > Show Scope Name ; youâll get a popup with some number of lines in it (how many depends on where you are in the file, the type, etc); the very first line is the value you should use for the selector key.
Example: You are working with Python files and you want to create a build for them; from inside of a Python file you choose the menu item and see this:
The first line is source.python, so your build might look like:
All this said, itâs possible that there might be more than one build that applies to the current type of file. For example, the Python build that ships with Sublime can work two ways; also any builds that donât have an explicit selector in them can conceivably work for all types of files.
In such a case, the first time you run the build youâll be presented with a list of options for the build to use. Once you pick one, the build will run and then going forward Sublime will remember your choice every time you build. Thus, you only need to tell it once what build to use. If you want to change your mind, Tools > Build With will run the build and prompt you again.
I have a video series all about builds and how they work that may prove helpful for demonstration purposes: