Permalink
Browse files

Added the Rust filetype

  • Loading branch information...
dobkeratops authored and SiegeLord committed Oct 18, 2013
1 parent ad59468 commit b17b4be1260e8828f62c56c87cf8bf886cbbf3b4
Showing with 61 additions and 0 deletions.
  1. +51 −0 data/filetypes.rust
  2. +9 −0 src/filetypes.c
  3. +1 −0 src/filetypes.h
View
@@ -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"
+
View
@@ -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;
+
}
View
@@ -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 */
}

0 comments on commit b17b4be

Please sign in to comment.