Add file support for more file-types
- and syntax highlighting for bash
This commit is contained in:
24
include/ts_def.h
Normal file
24
include/ts_def.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "../libs/tree-sitter/lib/include/tree_sitter/api.h"
|
||||
#include <string>
|
||||
|
||||
struct Language {
|
||||
std::string name;
|
||||
const TSLanguage *(*fn)();
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
const TSLanguage *tree_sitter_bash(void);
|
||||
const TSLanguage *tree_sitter_c(void);
|
||||
const TSLanguage *tree_sitter_cpp(void);
|
||||
const TSLanguage *tree_sitter_css(void);
|
||||
const TSLanguage *tree_sitter_fish(void);
|
||||
const TSLanguage *tree_sitter_go(void);
|
||||
const TSLanguage *tree_sitter_haskell(void);
|
||||
const TSLanguage *tree_sitter_html(void);
|
||||
const TSLanguage *tree_sitter_javascript(void);
|
||||
const TSLanguage *tree_sitter_json(void);
|
||||
const TSLanguage *tree_sitter_lua(void);
|
||||
const TSLanguage *tree_sitter_make(void);
|
||||
const TSLanguage *tree_sitter_python(void);
|
||||
const TSLanguage *tree_sitter_ruby(void);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
#include "./ts_def.h"
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
#include <string>
|
||||
@@ -33,5 +34,8 @@ uint32_t get_bytes_from_visual_col(const char *line,
|
||||
uint32_t target_visual_col);
|
||||
void log(const char *fmt, ...);
|
||||
std::string get_exe_dir();
|
||||
char *load_file(const char *path, uint32_t *out_len);
|
||||
char *detect_file_type(const char *filename);
|
||||
Language language_for_file(const char *filename);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user