« first day (190 days earlier)      last day (2990 days later) » 

 
3 hours later…
04:41
Monknight
 
7 hours later…
Why thank you @Duga!
 
5 hours later…
17:16
 
2 hours later…
18:54
> Some of these properties don't have a place in configuration, such as Type and Description.
The only configurable properties should be On/Off and Suggestion/Warning. I'm honestly not 100% sure about the Suggestion/Warning either. Thoughts @retailcoder?
> The design was improved since this issue was created; the configurable properties were boiled down to `Severity`:

- `CodeInspectionSeverity.DoNotShow`
- `CodeInspectionSeverity.Hint`
- `CodeInspectionSeverity.Suggestion`
- `CodeInspectionSeverity.Warning`
- `CodeInspectionSeverity.Error`
@RubberDuck ^^
Ahhh okay.
That makes it easier actually.
Two properties. A name (which is the key) and a severity.
19:10
And the "type" (code quality issues, readability/maintainability) can be used to regroup them
Hmmm interesting challenge there.
type shouldn't be configurable, but we need to know it.
Okay.
^^ should we go there as well?
No. Too damn hard in VB. You'd constantly be fighting the IDE.
XML sucks by the way.
  <CodeInspectionSettings>
    <CodeInspections>
      <QualityInspections>
        <QualityInspection Name="" Severity=""/>
      </QualityInspections>
      <MaintainabilityInspections>
        <MaintainabilityInspection Name="" Severity=""/>
      </MaintainabilityInspections>
    </CodeInspections>
  </CodeInspectionSettings>
19:18
huh?
Oh nothing. It's just more verbose than VB.
<CodeInspections>
    <Inspection Type="CodeQualityIssues" Name="" Severity="" />
    <Inspection Type="MaintainabilityAndReadabilityIssues" Name="" Severity="" />
</CodeInspections>
?
hmm perhaps this enum needs better members:
namespace Rubberduck.Inspections
{
    [ComVisible(false)]
    public enum CodeInspectionType
    {
        MaintainabilityAndReadabilityIssues,
        CodeQualityIssues
    }
}
Where does that live?
lol was going to say Ctrl+T "CodeInspectionType".... dude you need R# ;)
@Mat'sMug No, because both types will inherit from an abstract class where Type gets over ridden.
Wait.......
I need to think about this.
19:23
Ctrl+T
Yeah. You're right.
It's an attribute.
I also forgot that serialization doesn't seem to be able to handle enums. They have to be cast later on.
that's fine
@RubberDuck if we ever figure out a way to make keyboard shortcuts work in the VBE.... I want a Ctrl+T!
19:39
LOL. Okay Mug. One problem at a time buddy. =;)-
Yeah. Speaking of problems to solve. I'm creating an InspectionNames.resx to keep the names in. That way they're consistant from setting to actual object.
good!
Added benefit of easier localization should that ever occur.
19:58
Monking VBAddicts!
hey @Phrancis
@Phrancis hola
> switched inspection names to resx file
> Guts tell me there's an issue with the ParameterSyntax regex.
        public static string ParameterSyntax
        {
            get
            {
                var syntax =
                    @"(?:(?<parameter>(?:\s?(?<optional>Optional)\s)?(?<by>ByRef|ByVal|ParamArray)?\s)?(?:" +
                    IdentifierSyntax +
                    @")(?<specifier>[%&@!#$])?(?<array>\((?<size>(?:(?:[0-9]+)\,?\s?)*|(?:[0-9]+\sTo\s[0-9]+\,?\s?)+)\))?(?<as>\sAs(?:\s" +
                    ReferenceSyntax +
                    @")?)*)";

                return syntax;
FML
20:14
What the...
Is that for parsing some XML or something?
2
that's how the parser finds parameters in a procedure's signature
    private static string IdentifierSyntax { get { return @"(?<identifier>(?:[a-zA-Z][a-zA-Z0-9_]*)|(?:\[[a-zA-Z0-9_]*\]))"; } }
    private static string ReferenceSyntax { get { return @"(?:(?<reference>(?:(?:(?<library>[a-zA-Z][a-zA-Z0-9_]*))\.)*)?" + IdentifierSyntax + ")"; } }
too much regex.... brain explodes
2
20:55
@RubberDuck Now you have... three problems!
@Phrancis not really
Hah, guess if it works, it works!
I mean, all these regexes are built - and debugged - using Expresso.
        private IEnumerable<ParameterNode> CreateParameters(string scope, Match match)
        {
            var parameters = match.Groups["parameter"].Captures.Cast<Capture>();
            var pattern = VBAGrammar.ParameterSyntax;
            var caret = 0;
            foreach (var parameter in parameters.Where(p => !string.IsNullOrEmpty(p.Value)).OrderBy(p => p.Index))
            {
                // todo: stop assuming the instruction sits on a single line of code _
                var subMatch = Regex.Match(parameter.Value, pattern);
and since the code is grabbing the parameter capture group...
oh shit
the parameter group is from the ProcedureSyntax regex..
this is the parameter group: (?<parameter>(?:[^,)]*)(?:\,\s)?)
it's excluding the closing parenthese character
found your culprit eh?
@Mat'sMug any idea what the default severities of the things you implemented should be?
I don't see them getting set anywhere.
in their respective default constructor ;)
public OptionExplicitInspection()
{
    Severity = CodeInspectionSeverity.Warning;
}
21:09
Ahhhhhh okay.
Just spotted that.
Okay then. Another puzzle to ponder on. =)
why?
the default constructor runs, assigns the default value - then the config gets applied, overrides the default severity value, no?
Yeah. So what's the point of having it in the constructor other than to confuse us 6 months from now?
...making sure there's always a default value for it?
Yeah..... hence the puzzle.
I don't understand
var inspection = new SomeInspection { Severity = config.Value }; would work just fine
21:16
I think I might have designed the config poorly. Not sure how to explain.
I removed the ) from the excluded characters in ProcedureSyntax... and now the parser is SLOW AS FUCK
One of those Saturdays I guess.
I'm thinking beer & pizza when the wife & kids get home...
Sometimes I swear building this thing is more work than work.
yeah.. it's more fun too :)
@RubberDuck seriously... took ~3 minutes to parse the 4 projects I have opened.
(normally < 1 second)
Ouch.
Like, I just cut my effin' leg off ouch.
yeah, that
the good news.... it correctly treats array parameters as, well, parameters
...but when a function returns a Variant(), it thinkgs it's returning an implicit variant....
> Public Function ToArray() As Variant()
^^ this completely messes it up
it thinks there's an implicit ByRef parameter, and that it's returning an implicit variant :(
21:29
Well...... fuck.
34 mins ago, by Phrancis
@RubberDuck Now you have... three problems!
damn. he called it
2
On the bright side of things though.
yay!
I need to re-think the whole signature parsing
Well... regex is slow. Perhaps a more traditional parsing approach?
21:46
> Default Inspection Config Works
> moved user settings and configurationloader into thier own files
that regex is slow and buggy. I need a better one ;)
A syntax node can't quite exist without a regex. I might have fucked up.. big, big time.
Or I guess I can add a ctor overload...
22:02
Deserializer works.
<?xml version="1.0" encoding="utf-8"?>
<Configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <UserSettings>
    <ToDoListSettings>
      <ToDoMarkers>
        <ToDoMarker Text="NOTE:" Priority="0" />
        <ToDoMarker Text="TODO:" Priority="2" />
        <ToDoMarker Text="BUG:" Priority="2" />
      </ToDoMarkers>
    </ToDoListSettings>
    <CodeInspectinSettings>
      <CodeInspections>
        <CodeInspection Name="Option Explicit is not specified" Severity="3" InspectionType="1" />
Now I've just gotta wire things up and work out the kinks bugs.
Oh..... and build the UI.....
Hmmmmm...... code smell
        _settingsControl = new TodoListSettingsControl(new TodoSettingModel(new List<ToDoMarker>(_config.UserSettings.ToDoListSettings.ToDoMarkers)));
22:15
> inspection severity gets loaded from config file
Easy part's done @Duga.
Time for some family time.
22:53
0
Q: Unable to run a power point macro from perl

Mohammed RIzwan KhanI have a macro written in powerpoint and i need to call it from my perl script, it is possible to call a macro from Excel using $Excel->Run("MYMACRONAMEHERE"); but using "Run" with powerpoint is giving the below error: OLE exception from "Microsoft PowerPoint 2010": Application.Run : Invalid req...

^^ might be a problem with unit tests

« first day (190 days earlier)      last day (2990 days later) »