-
-
Notifications
You must be signed in to change notification settings - Fork 192
Added Tex Language Support #569
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
Open
isaacST08
wants to merge
71
commits into
NotAShelf:main
Choose a base branch
from
isaacST08:feature-language-tex
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 65 commits
Commits
Show all changes
71 commits
Select commit
Hold shift + click to select a range
ac75542
Created tex language options
isaacST08 7dceb8b
Fix import on the wrong line
isaacST08 d42896b
Added toString functions on Texlab LSP source booleans and other mapp…
isaacST08 286f292
Fixed typo
isaacST08 4fbc78c
Created function to simplify converting a string into lua format and …
isaacST08 186b6fd
Fixed weird nix boolean toString implementation
isaacST08 8a2a635
Changed texlab lsp config build.filename to use stringToLua function
isaacST08 52d36c0
Added tex to the languages list
isaacST08 25e2cfa
Fixed texlab needing to be installed globally to be able to use the lsp
isaacST08 60fe055
Added support for setting the g:tex_flavor option
isaacST08 187bf3e
Switched to Alejandra formatting style
isaacST08 d5920d1
Tex templates were broken in the current version of the new-file-temp…
isaacST08 54a64a4
Added texlab tectonic options
isaacST08 e78b4ff
Starting modularizing tex.nix into smaller sections
isaacST08 8f042ce
Moved lsp config into its own module
isaacST08 aa191b6
Migrated texlab into its own module
isaacST08 7ebbe28
Cleanup residue from modularization
isaacST08 31f212b
Created build module
isaacST08 2c856dc
Cleanup after makeing build module
isaacST08 77bb18f
Fixed typo
isaacST08 2e55442
Created builder template for making new builders that will work with …
isaacST08 aa75d98
Created latexmk builder
isaacST08 e0f0017
Pinned commit hash of new-file-template.nvim
isaacST08 a2ffaf8
Switched to using lib.nvim.config.mkBool where appropriate
isaacST08 8d7cac7
Refactored to use the nvf library toLuaObject as well as other improv…
isaacST08 847c1b5
Added diagnostic options for texlab
isaacST08 39fd4fe
Added general texlab options and some cleanup
isaacST08 179418e
Added latexindent options to texlab
isaacST08 a5fb966
Added completion options for texlab
isaacST08 80938d1
Added inlayHints options for texlab and some cleanup
isaacST08 9300f92
Added experimental options for texlab
isaacST08 d7de68f
Removed old files
isaacST08 06fbacb
Added enum options for completion matcher option
isaacST08 b4098ad
Added chktex options for texlab
isaacST08 0c3c67d
Added symbol options for texlab
isaacST08 35430ca
Cleanup: Sorted sections alphabetically, utilized inherrits where app…
isaacST08 4b2d169
Further Cleanup
isaacST08 ac062b2
Created PDF viewer framework
isaacST08 892f3d6
PDF Viewer framework bug fixes and integrated functionallity into tex…
isaacST08 4a581e9
Added more pdf viewer options
isaacST08 594d7b4
Reorganized file and options structure for more intuitive use
isaacST08 08a7748
Fixed typos and formatting
isaacST08 b30727e
Created mkEnableTreesitterOption in the extendend library
isaacST08 3c8fde8
Rebase & Merge
isaacST08 44c007f
Added usage of lib.optionals and created an assersion to check the nu…
isaacST08 29d7815
Added code/keyword md escaping for documentation in modules/plugins/l…
isaacST08 290f4e5
Added code/keyword md escaping for documentation in modules/plugins/l…
isaacST08 937f48d
Removed duplicate "Whether to enable" in documentation for modules/pl…
isaacST08 6c3efb5
Removed duplicate "Whether to enable" in documentation for modules/pl…
isaacST08 6a80573
Clarified documentation wording and utilized mkPackageOption for the …
isaacST08 123027e
Created assertion for the correct number of pdf viewers instead of th…
isaacST08 e640fef
Cleaned up documentation and other performed other code cleanups
isaacST08 2e326bd
Utilized lib.optionalAttrs to simplify code
isaacST08 d643334
Added comment explaining why code is structured as it is
isaacST08 bd90630
Cleaned up tectonic args processing
isaacST08 1275231
Reword doc description
isaacST08 af04bec
Altered mkEnableTreesitterOption functionallity to take in a boolean …
isaacST08 9211746
Changed the new-file-template-nvim npin to the fork that adds escapin…
isaacST08 3859b8d
Fixed missing mkOption function call in tectonic.nix
isaacST08 2393647
Fixed typo in default.nix
isaacST08 f57dbd0
Fixed typo in tectonic.nix
isaacST08 d65c480
Started work to resolve infrec error
isaacST08 3433bf9
Refactored pdfViewer and fixed infrec error
isaacST08 353b63b
Added description for pdf viewer
isaacST08 4d80eeb
Changed lsp enable config variable referenced
isaacST08 0da99e0
Removed builderTemplate implementation in favour of an inline approach
isaacST08 0e3fc24
Simplified pdfViewer configuration implementation
isaacST08 2334909
Updated texlab lsp to reference and respect the pdfViewer options
isaacST08 d104e38
Migrated lsp configs to new standard (non-lspconfig)
isaacST08 dc5a2b8
Reimplemented formatters
isaacST08 bbf7ea6
Fixed typo in modules/plugins/languages/tex/formatter.nix
isaacST08 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
modules/plugins/formatter/conform-nvim/builders/builderTemplate.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # This function acts as a template for creating new builders. | ||
| # It enforces providing all the parameters required for creating | ||
| # a new builder for it to be able to work in the existing code. | ||
| # | ||
| # The first layer requirements are as follows: | ||
| { | ||
| # This is the name of the builder, it will only be used internally and | ||
| # should match the <name>.nix file that the builder is implemented in. | ||
| name, | ||
| # | ||
| # Module attribute set. This is the attribute set that the module that is | ||
| # defining a builder is passed as its input. | ||
| moduleInheritancePackage, | ||
| # | ||
| # These are the standard options for the builder just like creating any | ||
| # other module. Some options are required and are described below but | ||
| # it will also accept any other options that are provided to it. | ||
| options, | ||
| # | ||
| # These are the command line arguments that will accompany the executable | ||
| # when the build command is called. | ||
| # This is a function that will take in the cfg of its own builder. | ||
| # i.e. will be called as "args cfg.build.builders.${name}" | ||
| args, | ||
| ... | ||
| }: let | ||
| # Inherit the necessary variables available to any module. | ||
| inherit (moduleInheritancePackage) lib config; | ||
| # | ||
| # Inherit other useful functions. | ||
| inherit (lib.modules) mkIf; | ||
| # | ||
| # Set the cfg variable | ||
| cfg = config.vim.languages.tex; | ||
| in { | ||
| # These are the options for the builder. It will accept any options | ||
| # provided to it but some options are mandatory: | ||
| options.vim.languages.tex.build.builders.${name} = ({ | ||
| # The enable option. This one is self explanatory. | ||
| enable, | ||
| # | ||
| # This is the package option for the builder. | ||
| package, | ||
| # | ||
| # This is the executable that will be used to call the builder. | ||
| # It, along with package will result in: | ||
| # "<package_path>/bin/<executable>" | ||
| executable, | ||
| # | ||
| # Any other options provided are accepted. | ||
| ... | ||
| } @ opts: | ||
| opts) | ||
| options; | ||
|
|
||
| # Check that the language and this builder have been enabled | ||
| # before making any config. | ||
| config = mkIf (cfg.enable && cfg.build.builders.${name}.enable) { | ||
| vim.languages.tex.build.builder = { | ||
| inherit name; | ||
| package = cfg.build.builders.${name}.package; | ||
| executable = cfg.build.builders.${name}.executable; | ||
| args = args cfg.build.builders.${name}; | ||
| }; | ||
| }; | ||
| } | ||
70 changes: 70 additions & 0 deletions
70
modules/plugins/formatter/conform-nvim/builders/default.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| { | ||
| config, | ||
| pkgs, | ||
| lib, | ||
| ... | ||
| }: let | ||
| inherit (lib.options) mkOption; | ||
| inherit (lib.types) enum listOf package str; | ||
| inherit (lib.nvim.config) mkBool; | ||
| inherit (builtins) attrNames filter isAttrs hasAttr elemAt length; | ||
|
|
||
| cfg = config.vim.languages.tex; | ||
| in { | ||
| imports = [ | ||
| ./latexmk.nix | ||
| ./tectonic.nix | ||
| ]; | ||
|
|
||
isaacST08 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| options.vim.languages.tex.build.builder = { | ||
| name = mkOption { | ||
| type = enum (attrNames cfg.build.builders); | ||
| default = "latexmk"; | ||
| description = '' | ||
| The tex builder to use. | ||
|
|
||
| This is just the default custom option. By setting any of the | ||
| builders to true, this will be overwritten by that builder's | ||
| parameters. | ||
| Setting this parameter to the name of a declared builder will | ||
| not automatically enable that builder. | ||
| ''; | ||
| }; | ||
| args = mkOption { | ||
| type = listOf str; | ||
| default = [ | ||
| "-pdf" | ||
| "%f" | ||
| ]; | ||
| description = '' | ||
| The list of args to pass to the builder. | ||
|
|
||
| This is just the default custom option. By setting any of the | ||
| builders to true, this will be overwritten by that builder's | ||
| parameters. | ||
| ''; | ||
| }; | ||
| package = mkOption { | ||
| type = package; | ||
| default = pkgs.texlive.withPackages (ps: [ps.latexmk]); | ||
| description = '' | ||
| The tex builder package to use. | ||
|
|
||
| This is just the default custom option. By setting any of the | ||
| builders to true, this will be overwritten by that builder's | ||
| parameters. | ||
| ''; | ||
| }; | ||
| executable = mkOption { | ||
| type = str; | ||
| default = "latexmk"; | ||
| description = '' | ||
| The tex builder executable to use. | ||
|
|
||
| This is just the default custom option. By setting any of the | ||
| builders to true, this will be overwritten by that builder's | ||
| parameters. | ||
| ''; | ||
| }; | ||
| }; | ||
| } | ||
57 changes: 57 additions & 0 deletions
57
modules/plugins/formatter/conform-nvim/builders/latexmk.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # TODO: I need testing. | ||
| { | ||
| pkgs, | ||
| lib, | ||
| ... | ||
| } @ moduleInheritancePackage: let | ||
| # The name of the builder | ||
| name = "latexmk"; | ||
|
|
||
| # The builder template | ||
| template = import ./builderTemplate.nix; | ||
|
|
||
| inherit (lib.options) mkOption mkEnableOption; | ||
| inherit (lib.types) bool package str; | ||
| in ( | ||
| template { | ||
| inherit name moduleInheritancePackage; | ||
|
|
||
| options = { | ||
| enable = mkEnableOption "Whether to enable Tex Compilation Via latexmk"; | ||
|
|
||
| package = mkOption { | ||
| type = package; | ||
| default = pkgs.texlive.withPackages (ps: [ps.latexmk]); | ||
| description = "latexmk package"; | ||
| }; | ||
|
|
||
| executable = mkOption { | ||
| type = str; | ||
| default = "latexmk"; | ||
| description = "The executable name from the build package that will be used to build/compile the tex."; | ||
| }; | ||
|
|
||
| # Flag options | ||
| pdfOutput = mkOption { | ||
| type = bool; | ||
| default = true; | ||
| example = false; | ||
| description = "Insure the output file is a pdf."; | ||
| }; | ||
| }; | ||
|
|
||
| args = builderCfg: ( | ||
| # Flags | ||
| ( | ||
| if builderCfg.pdfOutput | ||
| then ["-pdf"] | ||
| else [] | ||
| ) | ||
| # Base args | ||
| ++ [ | ||
| "-quiet" | ||
| "%f" | ||
| ] | ||
| ); | ||
| } | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.