Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolving bounty version 0.1 #2

Merged
merged 15 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI build

env:
config: Release
refactSolution: RefactExtension.sln
vsixContainer: ${{ github.workspace }}\RefactExtension.vsix
ACTIONS_ALLOW_UNSECURE_COMMANDS: true

on:
# Trigger the workflow on any pull request
pull_request:
workflow_dispatch:

jobs:
dist:
strategy:
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
code-target: win32-x64
- os: windows-latest
target: i686-pc-windows-msvc
code-target: win32-ia32
- os: windows-latest
target: aarch64-pc-windows-msvc
code-target: win32-arm64
env:
LLM_LS_TARGET: ${{ matrix.target }}

name: dist (${{ matrix.target }})
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: ${{ env.FETCH_DEPTH }}

- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: build.yml
repo: smallcloudai/refact-lsp
branch: main
path: ${{ github.workspace }}/MultilineGreyText/Resources
name: dist-${{ matrix.target }}

- name: Nerdbank.GitVersioning
uses: aarnott/nbgv@v0.3
id: nbgv

- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.0

- name: Setup NuGet.exe
uses: nuget/setup-nuget@v1
with:
nuget-version: 'latest'
- run: nuget restore ${{ env.refactSolution }}

- name: MSBuild ${{ env.refactSolution }}
run: |
msbuild ${{ env.refactSolution }} /p:Configuration=${{ env.config }} /p:TargetVsixContainer=${{ env.vsixContainer }} /p:DeployExtension=False /verbosity:minimal

- name: Upload VSIX artifact
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.target }}-${{ steps.nbgv.outputs.SemVer2 }}-${{ env.refactSolution }}
path: ${{ env.vsixContainer }}
196 changes: 196 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userprefs
*.sln.docstates
*.svclog
.vs/
.vscode/settings.json
MultilineGreyText/Resources/refact-lsp.exe

# Build results
[Aa]rtifacts/
[Dd]ebug/
[Rr]elease/
[Bb]inaries/
[Bb]in/
[Oo]bj/
.dotnet/
.tools/
.packages/
.nuget/

# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
!packages/*/build/

# Debug artifacts
launchSettings.json

# Prevent accidental re-checkin of NuGet.exe
NuGet.exe

# NuGet restore semaphore
build/ToolsetPackages/toolsetpackages.semaphore

# NuGet package
src/Tools/UploadNugetZip/*.zip

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
UnitTestResults.html

# NuGet V3 artifacts
*-packages.config
*.nuget.props
*.nuget.targets
project.lock.json
msbuild.binlog
*.project.lock.json

*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.wrn
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc

# Visual Studio cache files
*.sln.ide/

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
*.VC.opendb
*.VC.db

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
*.ncrunch*
.*crunch*.local.xml

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.Publish.xml

# NuGet Packages Directory
packages/

# Windows Azure Build Output
csx
*.build.csdef

# Windows Store app package directory
AppPackages/

# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
App_Data/*.mdf
App_Data/*.ldf


#LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml

# =========================
# Windows detritus
# =========================

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac desktop service store files
.DS_Store

# JetBrains Rider
.idea/

# WPF temp projects
*wpftmp.*
38 changes: 38 additions & 0 deletions MultilineGreyText/MultilineGreyTextProvider.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using EnvDTE;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor;
using Microsoft.VisualStudio.Text.Tagging;
using Microsoft.VisualStudio.Utilities;
using System;
using System.ComponentModel.Composition;

namespace RefactAI{

[Export(typeof(IViewTaggerProvider))]
[TagType(typeof(TestTag))]
[ContentType("text")]
internal sealed class MultilineGreyTextProvider : IViewTaggerProvider{

// Disable "Field is never assigned to..." and "Field is never used" compiler's warnings. Justification: the field is used by MEF.
#pragma warning disable 649, 169

/// <summary>
/// Defines the adornment layer for the scarlet adornment. This layer is ordered
/// after the selection layer in the Z-order
/// </summary>
[Export(typeof(AdornmentLayerDefinition))]
[Name("RefactAI")]
[Order(After = PredefinedAdornmentLayers.Caret)]
private AdornmentLayerDefinition editorAdornmentLayer;

#pragma warning restore 649, 169

//create a single tagger for each buffer.
//the MultilineGreyTextTagger displays the grey text in the editor.
public ITagger<T> CreateTagger<T>(ITextView textView, ITextBuffer buffer) where T : ITag{
Func<ITagger<T>> sc = delegate () { return new MultilineGreyTextTagger((IWpfTextView)textView, buffer) as ITagger<T>; };
return buffer.Properties.GetOrCreateSingletonProperty<ITagger<T>>(typeof(MultilineGreyTextTagger), sc);
}
}
}
Loading