diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..3eddd09 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + # Maintain dependencies for GitHub Actions + - package-ecosystem: 'github-actions' + directory: '/' + schedule: + interval: 'daily' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c4b3f4c --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,49 @@ +name: Build + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + Solution_Name: shader-ls.sln + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + #- ubuntu-latest + #- macos-latest + - windows-latest + configuration: [Debug, Release] + + steps: + - uses: actions/checkout@v4 + + # Install the .NET Core workload + - name: Install .NET Core + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + + - name: Setup MSBuild.exe + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Execute unit tests + working-directory: Server + run: dotnet test + + - name: Build the application + working-directory: Server + run: msbuild $env:Solution_Name /t:Rebuild /p:Configuration=$env:Configuration + env: + Configuration: ${{ matrix.configuration }} diff --git a/.gitignore b/.gitignore index 3e759b7..c4f605c 100644 --- a/.gitignore +++ b/.gitignore @@ -328,3 +328,6 @@ ASALocalRun/ # MFractors (Xamarin productivity tool) working folder .mfractor/ + +# OS generated +.DS_Store diff --git a/CHANGELOG.md b/CHANGELOG.md index a98ef7c..9a77e29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,12 +5,26 @@ All notable changes to this project will be documented in this file. Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. -## 0.2.0 (Unreleased) +## Unreleased > Released N/A -* Fix completion in VSCode (d0cd9bfa15b175be30e5312215777c82a3e055e9) +* N/A + +## 0.1.3 +> Released Sep 09, 2023 + +* Platform specific directories to allow linux builds (#2) + +## 0.1.2 +> Released Aug 23, 2023 + * Rename `ShaderLab` section to `ShaderLS` (b43a5ac376f9537d014616df79e00d4912f7d86a) +## 0.1.1 +> Released Aug 23, 2023 + +* Fix completion in VSCode (d0cd9bfa15b175be30e5312215777c82a3e055e9) + ## 0.1.0 > Released May 05, 2023 diff --git a/LICENSE b/LICENSE index f08a77a..e3fb64e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 Shen, Jen-Chieh +Copyright (c) 2023-2025 Shen, Jen-Chieh Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index d96e050..bf6b7d7 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,8 @@ # shader-language-server > Language server implementation for ShaderLab +[![Build](https://github.com/shader-ls/shader-language-server/actions/workflows/test.yml/badge.svg)](https://github.com/shader-ls/shader-language-server/actions/workflows/test.yml) + ## 🚧 Status Still in development. @@ -26,7 +28,7 @@ Still in development. `dotnet tool install --global shader-ls` -See [shader-lsp nuget page](). +See [shader-lsp nuget page](https://www.nuget.org/packages/shader-ls/). ## 🔨 Usage diff --git a/Server/Handlers/SignatureHelpHandler.cs b/Server/Handlers/SignatureHelpHandler.cs index 1fb1857..86a4ae3 100644 --- a/Server/Handlers/SignatureHelpHandler.cs +++ b/Server/Handlers/SignatureHelpHandler.cs @@ -1,6 +1,4 @@ -using System.Linq; -using System.Security.Cryptography.Xml; -using System.Text.RegularExpressions; +using System.Text.RegularExpressions; using Microsoft.Extensions.Logging; using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities; using OmniSharp.Extensions.LanguageServer.Protocol.Document; @@ -8,7 +6,6 @@ using OmniSharp.Extensions.LanguageServer.Protocol.Server; using ShaderlabVS.Data; using ShaderLS.Management; -using static System.Net.Mime.MediaTypeNames; namespace ShaderLS.Handlers { diff --git a/Server/ShaderlabVS.Data/Attributes.cs b/Server/ShaderlabVS.Data/Attributes.cs index d986a3a..9dbecbf 100644 --- a/Server/ShaderlabVS.Data/Attributes.cs +++ b/Server/ShaderlabVS.Data/Attributes.cs @@ -1,6 +1,4 @@ -using System; - -namespace ShaderlabVS.Data +namespace ShaderlabVS.Data { [AttributeUsage(AttributeTargets.Property, Inherited = false, AllowMultiple = false)] sealed class DefinationKeyAttribute : Attribute diff --git a/Server/ShaderlabVS.Data/DefinationDataProvider.cs b/Server/ShaderlabVS.Data/DefinationDataProvider.cs index 298229d..317416e 100644 --- a/Server/ShaderlabVS.Data/DefinationDataProvider.cs +++ b/Server/ShaderlabVS.Data/DefinationDataProvider.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; +using System.Reflection; namespace ShaderlabVS.Data { diff --git a/Server/ShaderlabVS.Data/DefinationReader.cs b/Server/ShaderlabVS.Data/DefinationReader.cs index c25edaa..0ce5230 100644 --- a/Server/ShaderlabVS.Data/DefinationReader.cs +++ b/Server/ShaderlabVS.Data/DefinationReader.cs @@ -1,6 +1,4 @@ -using System.Collections.Generic; -using System.IO; -using System.Text; +using System.Text; using System.Text.RegularExpressions; namespace ShaderlabVS.Data diff --git a/Server/ShaderlabVS.Data/Models.cs b/Server/ShaderlabVS.Data/Models.cs index 0672996..7c9e9d8 100644 --- a/Server/ShaderlabVS.Data/Models.cs +++ b/Server/ShaderlabVS.Data/Models.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace ShaderlabVS.Data +namespace ShaderlabVS.Data { #region Common public class ModelBase diff --git a/Server/ShaderlabVS.Data/ShaderlabDataManager.cs b/Server/ShaderlabVS.Data/ShaderlabDataManager.cs index f2955e9..fdffee2 100644 --- a/Server/ShaderlabVS.Data/ShaderlabDataManager.cs +++ b/Server/ShaderlabVS.Data/ShaderlabDataManager.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; +using System.Reflection; namespace ShaderlabVS.Data { @@ -12,15 +8,15 @@ namespace ShaderlabVS.Data public class ShaderlabDataManager { #region Constants - public const string HLSL_CG_DATATYPE_DEFINATIONFILE = "Data\\HLSL_CG_datatype.def"; - public const string HLSL_CG_FUNCTION_DEFINATIONFILE = "Data\\HLSL_CG_functions.def"; - public const string HLSL_CG_KEYWORD_DEFINATIONFILE = "Data\\HLSL_CG_Keywords.def"; - - public const string UNITY3D_DATATYPE_DEFINATIONFILE = "Data\\Unity3D_datatype.def"; - public const string UNITY3D_FUNCTION_DEFINATIONFILE = "Data\\Unity3D_functions.def"; - public const string UNITY3D_KEYWORD_DEFINATIONFILE = "Data\\Unity3D_keywords.def"; - public const string UNITY3D_MACROS_DEFINATIONFILE = "Data\\Unity3D_macros.def"; - public const string UNITY3D_VALUES_DEFINATIONFILE = "Data\\Unity3D_values.def"; + public static string HLSL_CG_DATATYPE_DEFINATIONFILE = Path.Combine("Data", "HLSL_CG_datatype.def"); + public static string HLSL_CG_FUNCTION_DEFINATIONFILE = Path.Combine("Data", "HLSL_CG_functions.def"); + public static string HLSL_CG_KEYWORD_DEFINATIONFILE = Path.Combine("Data", "HLSL_CG_Keywords.def"); + + public static string UNITY3D_DATATYPE_DEFINATIONFILE = Path.Combine("Data", "Unity3D_datatype.def"); + public static string UNITY3D_FUNCTION_DEFINATIONFILE = Path.Combine("Data", "Unity3D_functions.def"); + public static string UNITY3D_KEYWORD_DEFINATIONFILE = Path.Combine("Data", "Unity3D_keywords.def"); + public static string UNITY3D_MACROS_DEFINATIONFILE = Path.Combine("Data", "Unity3D_macros.def"); + public static string UNITY3D_VALUES_DEFINATIONFILE = Path.Combine("Data", "Unity3D_values.def"); #endregion #region Properties @@ -69,7 +65,7 @@ public static ShaderlabDataManager Instance private ShaderlabDataManager() { - string currentAssemblyDir = (new FileInfo(Assembly.GetExecutingAssembly().CodeBase.Substring(8))).DirectoryName; + string currentAssemblyDir = (new FileInfo(Assembly.GetExecutingAssembly().Location)).DirectoryName; HLSLCGFunctions = DefinationDataProvider.ProvideFromFile(Path.Combine(currentAssemblyDir, ShaderlabDataManager.HLSL_CG_FUNCTION_DEFINATIONFILE)); List hlslcgKeywords = DefinationDataProvider.ProvideFromFile(Path.Combine(currentAssemblyDir, ShaderlabDataManager.HLSL_CG_KEYWORD_DEFINATIONFILE)); diff --git a/Server/ShaderlabVS/Utilities.cs b/Server/ShaderlabVS/Utilities.cs index 734d787..8edf39a 100644 --- a/Server/ShaderlabVS/Utilities.cs +++ b/Server/ShaderlabVS/Utilities.cs @@ -1,6 +1,4 @@ -using System; - -namespace ShaderlabVS +namespace ShaderlabVS { internal class Utilities { diff --git a/Server/shader-ls.csproj b/Server/shader-ls.csproj index 17fa181..f28930a 100644 --- a/Server/shader-ls.csproj +++ b/Server/shader-ls.csproj @@ -19,7 +19,7 @@ https://github.com/jcs090218/shader-language-server git language-server;shader;unity - 0.1.2 + 0.1.3 diff --git a/etc/logo.png b/etc/logo.png index 586b28e..31361ec 100644 Binary files a/etc/logo.png and b/etc/logo.png differ