[gnome-builder] spaces-style: add new flags type for spaces styling



commit 63ca00b33ddb90ae11082a8d44d95b2a019bcf73
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jan 29 16:26:08 2018 -0800

    spaces-style: add new flags type for spaces styling
    
    We can use this in file-settings to describe some basic spaces styling.
    Then from completion providers we can attempt to do the right thing.

 src/libide/files/ide-spaces-style.h | 37 +++++++++++++++++++++++++++++++++++++
 src/libide/files/meson.build        |  2 ++
 src/libide/ide-enums.c.in           |  1 +
 src/libide/ide.h                    |  2 ++
 4 files changed, 42 insertions(+)
---
diff --git a/src/libide/files/ide-spaces-style.h b/src/libide/files/ide-spaces-style.h
new file mode 100644
index 000000000..aec4af232
--- /dev/null
+++ b/src/libide/files/ide-spaces-style.h
@@ -0,0 +1,37 @@
+/* ide-spaces-style.h
+ *
+ * Copyright © 2018 Christian Hergert <chergert redhat com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+typedef enum
+{
+  IDE_SPACES_STYLE_IGNORE              = 0,
+  IDE_SPACES_STYLE_BEFORE_LEFT_PAREN   = 1 << 0,
+  IDE_SPACES_STYLE_BEFORE_LEFT_BRACKET = 1 << 1,
+  IDE_SPACES_STYLE_BEFORE_LEFT_BRACE   = 1 << 2,
+  IDE_SPACES_STYLE_BEFORE_LEFT_ANGLE   = 1 << 3,
+  IDE_SPACES_STYLE_BEFORE_COLON        = 1 << 4,
+  IDE_SPACES_STYLE_BEFORE_COMMA        = 1 << 5,
+  IDE_SPACES_STYLE_BEFORE_SEMICOLON    = 1 << 6,
+} IdeSpacesStyle;
+
+G_END_DECLS
diff --git a/src/libide/files/meson.build b/src/libide/files/meson.build
index 0d8558e72..e01a97453 100644
--- a/src/libide/files/meson.build
+++ b/src/libide/files/meson.build
@@ -3,6 +3,7 @@ files_headers = [
   'ide-file-settings.h',
   'ide-file-settings.defs',
   'ide-indent-style.h',
+  'ide-spaces-style.h',
 ]
 
 files_sources = [
@@ -12,6 +13,7 @@ files_sources = [
 
 files_enums = [
   'ide-indent-style.h',
+  'ide-spaces-style.h',
 ]
 
 libide_public_headers += files(files_headers)
diff --git a/src/libide/ide-enums.c.in b/src/libide/ide-enums.c.in
index 096864179..b3767a5f5 100644
--- a/src/libide/ide-enums.c.in
+++ b/src/libide/ide-enums.c.in
@@ -12,6 +12,7 @@
 #include "diagnostics/ide-diagnostic.h"
 #include "doap/ide-doap.h"
 #include "files/ide-indent-style.h"
+#include "files/ide-spaces-style.h"
 #include "highlighting/ide-highlighter.h"
 #include "runtimes/ide-runtime.h"
 #include "sourceview/ide-cursor.h"
diff --git a/src/libide/ide.h b/src/libide/ide.h
index 859bdc637..04aefc361 100644
--- a/src/libide/ide.h
+++ b/src/libide/ide.h
@@ -101,6 +101,8 @@ G_BEGIN_DECLS
 #include "editor/ide-editor-view.h"
 #include "files/ide-file-settings.h"
 #include "files/ide-file.h"
+#include "files/ide-indent-style.h"
+#include "files/ide-spaces-style.h"
 #include "genesis/ide-genesis-addin.h"
 #include "greeter/ide-greeter-section.h"
 #include "highlighting/ide-highlight-engine.h"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]