Added the Rust filetype
This commit is contained in:
parent
ad59468f3e
commit
b17b4be126
51
data/filetypes.rust
Normal file
51
data/filetypes.rust
Normal file
@ -0,0 +1,51 @@
|
||||
# For complete documentation of this file, please see Geany's main documentation
|
||||
[styling=C]
|
||||
|
||||
[keywords]
|
||||
# all items must be in one line
|
||||
primary=fn type as break const copy do else enum extern fail for if impl let log loop match mod mut priv pub ref return static struct trait unsafe use while in continue alignof be offsetof pure sizeof typeof yield
|
||||
secondary=bool int uint i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str Self self
|
||||
|
||||
[lexer_properties]
|
||||
styling.within.preprocessor=1
|
||||
lexer.cpp.track.preprocessor=0
|
||||
|
||||
[settings]
|
||||
lexer_filetype=C
|
||||
|
||||
# default extension used when saving files
|
||||
extension=rs
|
||||
|
||||
# the following characters are these which a "word" can contains, see documentation
|
||||
#wordchars=_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
|
||||
|
||||
# single comments, like # in this file
|
||||
comment_single=//
|
||||
# multiline comments
|
||||
comment_open=/*
|
||||
comment_close=*/
|
||||
|
||||
# set to false if a comment character/string should start at column 0 of a line, true uses any
|
||||
# indentation of the line, e.g. setting to true causes the following on pressing CTRL+d
|
||||
#command_example();
|
||||
# setting to false would generate this
|
||||
# command_example();
|
||||
# This setting works only for single line comments
|
||||
comment_use_indent=true
|
||||
|
||||
# context action command (please see Geany's main documentation for details)
|
||||
context_action_cmd=
|
||||
|
||||
[indentation]
|
||||
#width=4
|
||||
# 0 is spaces, 1 is tabs, 2 is tab & spaces
|
||||
#type=1
|
||||
|
||||
[build_settings]
|
||||
# %f will be replaced by the complete filename
|
||||
# %e will be replaced by the filename without extension
|
||||
# (use only one of it at one time)
|
||||
compiler=rustc "%f"
|
||||
linker=rustc -o "%e" "%f"
|
||||
run_cmd="./%e"
|
||||
|
@ -522,6 +522,15 @@ static void init_builtin_filetypes(void)
|
||||
ft->name = g_strdup("PowerShell");
|
||||
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||
ft->group = GEANY_FILETYPE_GROUP_SCRIPT;
|
||||
|
||||
#define RUST
|
||||
ft = filetypes[GEANY_FILETYPES_RUST];
|
||||
ft->lang = 45;
|
||||
ft->name = g_strdup("Rust");
|
||||
filetype_make_title(ft, TITLE_SOURCE_FILE);
|
||||
ft->mime_type = g_strdup("text/x-rustsrc");
|
||||
ft->group = GEANY_FILETYPE_GROUP_COMPILED;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -94,6 +94,7 @@ typedef enum
|
||||
GEANY_FILETYPES_ABAQUS,
|
||||
GEANY_FILETYPES_BATCH,
|
||||
GEANY_FILETYPES_POWERSHELL,
|
||||
GEANY_FILETYPES_RUST,
|
||||
/* ^ append items here */
|
||||
GEANY_MAX_BUILT_IN_FILETYPES /* Don't use this, use filetypes_array->len instead */
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user