Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Additional variables for titlebar #880

Closed
bryphe opened this issue Oct 21, 2019 · 5 comments
Closed

Feature: Additional variables for titlebar #880

bryphe opened this issue Oct 21, 2019 · 5 comments
Labels
A-extension Area: Extension/plugin integration, vscode or VimL A-workspace Area: Overall UX, editor layout, tabs/groups/splits etc. E-good-first-issue Call for participation: Good first issue E-help-wanted Call for participation: Help is requested to fix this issue. enhancement New feature or request

Comments

@bryphe
Copy link
Member

bryphe commented Oct 21, 2019

PR #879 adds a custom titlebar, that can be specified via the window.title configuration setting.

VSCode supports a rich set of configuration settings:

  // Controls the window title based on the active editor. Variables are substituted based on the context:
  // - `${activeEditorShort}`: the file name (e.g. myFile.txt).
  // - `${activeEditorMedium}`: the path of the file relative to the workspace folder (e.g. myFolder/myFileFolder/myFile.txt).
  // - `${activeEditorLong}`: the full path of the file (e.g. /Users/Development/myFolder/myFileFolder/myFile.txt).
  // - `${activeFolderShort}`: the name of the folder the file is contained in (e.g. myFileFolder).
  // - `${activeFolderMedium}`: the path of the folder the file is contained in, relative to the workspace folder (e.g. myFolder/myFileFolder).
  // - `${activeFolderLong}`: the full path of the folder the file is contained in (e.g. /Users/Development/myFolder/myFileFolder).
  // - `${folderName}`: name of the workspace folder the file is contained in (e.g. myFolder).
  // - `${folderPath}`: file path of the workspace folder the file is contained in (e.g. /Users/Development/myFolder).
  // - `${rootName}`: name of the workspace (e.g. myFolder or myWorkspace).
  // - `${rootPath}`: file path of the workspace (e.g. /Users/Development/myWorkspace).
  // - `${appName}`: e.g. VS Code.
  // - `${remoteName}`: e.g. SSH
  // - `${dirty}`: a dirty indicator if the active editor is dirty.
  // - `${separator}`: a conditional separator (" - ") that only shows when surrounded by variables with values or static text.
  "window.title": "${dirty}${activeEditorShort}${separator}${rootName}${separator}${appName}",

However, we only support the following right now:

  • ${activeEditorShort}
  • ${separator}
  • ${rootName}
  • ${dirty}

This is tracking adding the additional variables. The place these would be added is here:

let getTemplateVariables: Model.State.t => Core.StringMap.t(string) =

The getTemplateVariables takes our application state as a function, and returns a list of template variables -> values. We have both the workspace path as state.workspace.rootName and the active buffer file path available in that method, which should allow us to derive most of those.

@bryphe bryphe added enhancement New feature or request E-good-first-issue Call for participation: Good first issue E-help-wanted Call for participation: Help is requested to fix this issue. labels Oct 21, 2019
@glennsl glennsl added A-extension Area: Extension/plugin integration, vscode or VimL A-ux Area: Overall user experience and aesthetics labels Nov 18, 2019
@shulhi
Copy link
Contributor

shulhi commented Dec 2, 2019

I have some of the variables implemented and some that I'm not sure of how to proceed. Is it fine to do a PR for those variables I have implemented?

@bryphe
Copy link
Member Author

bryphe commented Dec 2, 2019

@shulhi - opening a PR would be great! Thank you for implementing some more of these 👍

@marcagba
Copy link
Contributor

Hi!
This is just to let you know that I'm currently working on exposing ${folderName} and ${folderPath} !

@marcagba
Copy link
Contributor

marcagba commented Jan 5, 2020

So, it turns out that, as long as #729 isn't implemented, ${rootName} ${rootPath}and ${folderName} ${folderPath} should return the same values !

From what I've seen, in vscode rootName and rootPath are related to the workspace's settings file. folderName and folderPath are related to the folders declared within the workspace settings (see Multi-root Workspace)

And ${remotePath}doesn't make sense for Oni2 for the time being, since there's currently no Remote development possibilities with Oni2.

PR coming soon !

@glennsl glennsl added A-workspace Area: Overall UX, editor layout, tabs/groups/splits etc. and removed A-ux Area: Overall user experience and aesthetics labels Feb 13, 2020
@bryphe
Copy link
Member Author

bryphe commented Dec 23, 2020

I believe these are mostly implemented now - we can look at implementing any remaining ones in a separate issue 👍

@bryphe bryphe closed this as completed Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-extension Area: Extension/plugin integration, vscode or VimL A-workspace Area: Overall UX, editor layout, tabs/groups/splits etc. E-good-first-issue Call for participation: Good first issue E-help-wanted Call for participation: Help is requested to fix this issue. enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants