Giter Club home page Giter Club logo

avalonia.ide's People

Contributors

donandren avatar kekekeks avatar rogalmic avatar shadowdancer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

avalonia.ide's Issues

End tag is incorrectly changed when adding property

<Grid>
   <$
</Grid>

Assume $ is cursor. User types "Grid.ColumnDefinitions".
Expected result:

<Grid>
   <Grid.ColumnDefinitions
</Grid>

Actual result:

<Grid>
   <Grid.ColumnDefinitions
</Grid.ColumnDefinitions>

This happens because "RenameEndTag" text manipulation matches <Grid.> with end tag, and it does not know, that user is typing Grid property and he will close that tag in future. I see 2 potential ways to solve this:

  1. When renaming tags, do not add . It will work, but may cut some useful features (ie. may rename tag partially, when user wants to add . - renaming Grid.ColumnDefinitions to Grid.RowDefinitions etc.)
  2. Give more context for xml analyzer, so it knows that tags won't match, like this:
<Grid> <!-- depth 0 -->
   <$  <!-- depth 1 -->
</Grid> <!-- depth 0 -->

Unify metadata for completion engine and xamlx

Atm XamlX reads metadata from reflection or cecil, and completion engine reads metadata from dnlib.

I think it would be reasonable to create shared metadata model for Xamlx and Completion engine, to reuse metadata for both validating xaml and completing. Also it would add third xaml type system, currently there are 2:

  1. reading form current appdomain
  2. reading from source files

and the proposed one:
3. reading from compiled assemblies

Metadata overlapped

Cosidering this wpf code:

we have three assemblies with the same class definition but different behavior

Ass1

namespace MyName
{
   public static readonly DependencyProperty IsBubbleSourceProperty = DependencyProperty.RegisterAttached(
            "IsBubbleSource",
            typeof(Boolean),
            typeof(AquariumObject),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender)
            );
  public static void SetIsBubbleSource(UIElement element, Boolean value)
  {
    element.SetValue(IsBubbleSourceProperty, value);
  }
  public static Boolean GetIsBubbleSource(UIElement element)
  {
    return (Boolean)element.GetValue(IsBubbleSourceProperty);
  }

}

Ass2

namespace MyName
{
   public static readonly DependencyProperty IsBubbleSourceProperty = DependencyProperty.RegisterAttached(
            "IsBubbleSource",
            typeof(Boolean),
            typeof(AquariumObject),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender)
            );
  public static void SetIsBubbleSource(UIElement element, Boolean value)
  {
    element.SetValue(IsBubbleSourceProperty, value);
  }
  public static Boolean GetIsBubbleSource(UIElement element)
  {
    return (Boolean)element.GetValue(IsBubbleSourceProperty);
  }
}

Ass3

namespace MyName
{
   public static readonly DependencyProperty IsBubbleSourceProperty = DependencyProperty.RegisterAttached(
            "IsBubbleSource",
            typeof(Boolean),
            typeof(AquariumObject),
            new FrameworkPropertyMetadata(false, FrameworkPropertyMetadataOptions.AffectsRender)
            );
  public static void SetIsBubbleSource(UIElement element, Boolean value)
  {
    element.SetValue(IsBubbleSourceProperty, value);
  }
  public static Boolean GetIsBubbleSource(UIElement element)
  {
    return (Boolean)element.GetValue(IsBubbleSourceProperty);
  }
}

and using like this:

<Usercontrol 
    ....
    xmlns:n1="clr-namespace:MyName;assembly=Ass1"
    xmlns:n2="clr-namespace:MyName;assembly=Ass2"
    xmlns:n3="clr-namespace:MyName;assembly=Ass3">
</Usercontrol> 

in Avalonia.Ide it is not valid because the metadata key is FullName, and having three classes with the same FullName they are overlapped.

var mt = types[type.FullName] = ConvertTypeInfomation(type);

Support partial metadata updates and invalidation

Currently metadata is singular "package", which is computed for dll and used by text completion engine.

This is not suitable for use in case extension is analysing source files at runtme. There should some notion of metadata "containers", which can be plugged or invalidated, and would provide similar interface to completionEngine as current implementation.

Build AST for XAML documents

Using language server protocol opens room for implementation of additional language features. However to do so probably AST of Xaml docuement is required. Here are few challenges - documents are updated incrementally, and they may not be valid xaml when user is typing.

I wonder if there is room for reusing xaml compiler, or maybe third party library like https://github.com/KirillOsenkov/XmlParser to grasp this requirement.
Especially linked lib looks promising, as it supports incremental updates of buffer, but I do not know how resilient it is to typing in editor.

Compilation error in XmlParser.cs

The new implementation of the Clone() method has a typo of a duplicate equals sign that prevents Avalon Studio from compiling.

var clonedStack = = new Stack<int>(new Stack<int>(_containingTagStart));

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.